Breaking News

How to Create a New Activity | Open New Activity in Android Studio Episode #008

How to Create a New Activity | Open New Activity in Android Studio

XML Code

<Button
android:id=”@+id/next”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:background=”#4CAF50″
android:layout_gravity=”center”
android:text=”Next Activity”
android:textSize=”30dp”
/>

 

Java Code

Button next;

next = (Button)findViewById(R.id.next);

 next.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(MainActivity.this, aboutus.class);
            startActivity(intent);
        }
    });
}

About Muhammad Arif

Muhammad Arif I am an SEO Expert, Social Media Marketer / Expert, Affiliate Marketer, Investor, Web Designer / Developer, Programmer(HTML, CSS, Java Script , PHP+ SQL) . I am also blogger and a writer. I am working on internet as Internet Business Promoter to 4 years. I am also working as Freelancer on Fiverr. My first earning from Internet $300. I was earn $300 from CPA product. I have complete SEO Expert Training in 2015. I am owner of 4 Blogs. I have launched 2 Digital Product. I was start Training for newbie to 3 months. I have Trained 100+ students.