Don't Miss

Intent – Receives data from activity android

By on January 10, 2018

Activity.java

 

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

public class ExampleActvity2 extends AppCompatActivity {

private String name,phone;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

name = getIntent().getStringExtra(“name”);
phone = getIntent().getStringExtra(“phonenum”);

Toast.makeText(this, “Name : “+name+”\n”+”Phone :”+phone, Toast.LENGTH_SHORT).show();

}
}

 

About CodingBazz

Leave a Reply

Your email address will not be published. Required fields are marked *