Hyderabad, , India
Android, C Plus Plus, HTML
0 टिप्पणी करें | 31 लोगो ने देखा है | 02 अप्रैल 13  | Srinivasarao Mahanti
Passing Data from One Intent to Another Intent:
Passing Data from One Intent to Another Intent Here I used two Activity classes to pass data from one activity to another activity through Intents. Main Activity.java which Intent send the data public class MainActivity extends Activity implements OnClickListener EditText name, pwd Button sub Override protected void onCreateBundle savedInstanceState super.onCreatesavedInstanceState setContentViewR.layout.main nameEditTextfindViewByIdR.id.NameText pwdEditTextfindViewByIdR.id.PassWordText subButtonfindViewByIdR.id.button1 sub.setOnClickListenerthis Override public void onClickView v String enamename.getText.toString String epwdpwd.getText.toString Intent intnnew IntentMainActivity.this,SecondActivity.class // here putExtrakeyvalue,value // here keyvalue is a key value to identify value from first intent in another intent. Value is value which you are passing to another intent. intn.putExtraquotNamequot,ename intn.putExtra quotPassWquot,epwd startActivityintn Second Activity.java which receives that data and prints that data public class SecondActivity extends Activity implements OnClickListener Button get,search EditText nm,pw String sname,spwd Override protected void onCreateBundle savedInstanceState super.onCreatesavedInstanceState setContentViewR.layout.second getButtonfindViewByIdR.id.button nmEditTextfindViewByIdR.id.editName pwEditTextfindViewByIdR.id.editPassWord searchButtonfindViewByIdR.id.Searchbutton search.setOnClickListenerthis get.setOnClickListenerthis //Bundle is using to get the intent extra fileds from passing intent. Bundle bgetIntent.getExtras snameb.getStringquotNamequot spwdb.getStringquotPassWquot Override public void onClickView v // TODO Auto-generated method stub ifvget nm.setTextsname pw.setTextspwd else ifvsearch Intent intnnew IntentIntent.ACTIONVIEW intn.setDataUri.parsequothttp//www.google.com/quot startActivityintn

    • इस ब्लॉग के लिए सामाजिक शेयर

पोर्फोलिओ और ब्लॉग
Srinivasarao Mahanti विभिन्न कंपनियों का अनुसरण करता है, ये कंपनियां और नियोक्ता Srinivasarao के फिर से शुरू देख सकते हैं
सबसे अच्छा नौकरी के अवसर पाने के लिए अपना फिर से शुरू करें अपलोड करें

मुफ्त रजिस्टर करें!