i have trial.java as:
public void onClick(View v)
{
switch (v.getId())
{
case R.id.btnSequence:
Intent intent1 = new Intent();
intent1.setClass(this,CommonActivity .class);
String val1 = null;
intent1.putExtra("Value", val1);//passing val1 to
CommonActivity.java
startActivity(intent1);
break;
case R.id.btnVideo:
Intent intent2 = new Intent();
intent2.setClass(this,CommonActivity .class);
String val2 = null;
intent2.putExtra("Value", val2););//passing val2 to
CommonActivity.java
startActivity(intent2);
break;
case R.id.btnInfo:
Intent intent3 = new Intent();
intent3.setClass(this,CommonActivity .class);
String val3 = null;
intent3.putExtra("Value", val3););//passing val3 to
CommonActivity.java
startActivity(intent3);
break;
}
}
and in CommonActivity.java i want to do something like this:
public class CommonActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Intent getIntent = new Intent();
getIntent.getExtra("Value"); //confusion with **getExtras**
//here i want something like this:
//if(getExtra.equals(val1)) //confusion with **getExtras**
{
//some stuff
}
//if(getExtra.equals(val2)) //confusion with **getExtras**
{
//some stuff
}
}
}
also while searching on net i got confused with getExtras and
getextra.can anybody please example the scenario of using getExtra vs
getExtras!so that i can decide to use better one in my application
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en