我想從這個活動如何從標籤活動通過意向
public class HomeActivity extends android.app.TabActivity
{
String uid;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
TabHost tabHost = getTabHost();
Intent intent = getIntent();
uid = intent.getStringExtra("uid");
// Tab for ActivityOne
TabSpec photospec = tabHost.newTabSpec("Home");
photospec.setIndicator("Home", getResources().getDrawable(R.drawable.one));
Intent photosIntent = new Intent(this, TabhomeActivity.class);
photosIntent.putExtra("uid", uid);
// startActivityForResult(photosIntent,0);
photospec.setContent(photosIntent);
// Tab for ActivitySecond
TabSpec songspec = tabHost.newTabSpec("Today's Meeting");
// setting Title and Icon for the Tab
songspec.setIndicator("Today's Meeting",
getResources().getDrawable(R.drawable.one));
Intent songsIntent = new Intent(this,TodaysmeetingActivity.class);
songspec.setContent(songsIntent);
// Adding all TabSpec to TabHost
tabHost.addTab(photospec); // Adding photos tab
tabHost.addTab(songspec); // Adding songs tab
}
}
這一活動送超值值發送到活動..
public class TabhomeActivity extends Activity {
Button button1;
Button button2;
Button button3;
TextView txtview,shwname;
String uid;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tabhome);
Intent intent = getParent().getIntent();
uid = intent.getStringExtra("uid");
shwname=(TextView)findViewById(R.id.textView3);
shwname.setText("Hi\t"+uid);
}
誰能幫助我?請。提前致謝。
究竟是不是工作?從該段落髮布LogCat plz – bofredo 2013-04-26 09:29:53
我沒有得到我的TabHomeActivity的意圖值 – priya89 2013-04-26 09:44:47