Skip to main content

Featured

Game Development Tutorials In Android

Game Development Tutorials In Android Hi Guys,                 We are shortly started Game Development Tutorials in Android Studio. So everyone supports me and share this blogs to your friends. Guys, At this time everyone is freely available to source code and we are provide a video for step by step game developments. you are learn free and feel free to support us. Guys, if you have any question to me, so feel free to comment us. I will try to answer all the question as long as possible.                                                     Thank's                                                                          ...

Android Application Development Tutorials PART-II (OnClick Action to Perform MainActivity to NextActivity)

Android Apps Developments Tutorials

Our first On Button Clicked Action in Android Application Tutorials

                           activity_main.xml


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

<Button
                android:hint = "Click Event"
                android:id="@+id/buttonClick"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

</RelativeLayout>


                                      MainActivity.java

package com.example.javasmartsupport.star;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class TestActivity extends AppCompatActivity {
  

                          @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

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

       buttonClick.setOnClickListener(new View.OnClickListener() 
       {
  
        @Override
        public void onClick(View v) {
            
           Intent upVid = new Intent(MainActivity.this, NextActivity.class);
                startActivity(upVid);

       }
  });



   }
}

Comments