我試圖通過與活動使用意圖傳遞活動
我使用意圖定期活動
之間傳遞數據考慮如下::
AndroidTabRestaurantDescSearchListView.java
public class AndroidTabRestaurantDescSearchListView extends TabActivity {
// TabSpec Names
private static final String INBOX_SPEC = "Rating";
private static final String OUTBOX_SPEC = "Price";
Button Photos;
Button Filter;
Button Search;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabHost = getTabHost();
// Inbox Tab
TabSpec inboxSpec = tabHost.newTabSpec(INBOX_SPEC);
Intent inboxIntent = new Intent(this, RatingDescriptionSearchActivity.class);
inboxSpec.setIndicator(INBOX_SPEC);
// Tab Content
inboxSpec.setContent(inboxIntent);
// Outbox Tab
TabSpec PriceSpec = tabHost.newTabSpec(OUTBOX_SPEC);
Intent PriceIntent = new Intent(this, PriceDescriptionSearchActivity.class);
PriceSpec .setIndicator(OUTBOX_SPEC);
PriceSpec.setContent(PriceIntent);
// Adding all TabSpec to TabHost
tabHost.addTab(inboxSpec);
tabHost.addTab(PriceSpec);
//Set the current value tab to default first tab
tabHost.setCurrentTab(0);
}
}
假設我從Someother發送數據活動稱爲Activity-1
到AndroidTabRestaurantDescSearchListView
的意圖
現在,我怎麼能接受的數據AndroidTabRestaurantDescSearchListView
這是我從Activity-1
了,然後再次將其傳遞給RatingDescriptionSearchActivity
Pictoral表示是 ::
{編輯} - 如果這是可能的基礎上的答案---歧義,因爲AndroidTabRestaurantDescSearchListView是一個標籤活動
TabSpec inboxSpec = tabHost.newTabSpec(INBOX_SPEC);
Intent inboxIntent = new Intent(this, RatingDescriptionActivity.class);
intent.putExtra("keyName", value);
inboxSpec.setIndicator(INBOX_SPEC);
// Tab Content
inboxSpec.setContent(inboxIntent);
看到這將幫助你http://stackoverflow.com/questions/18649728/android-cannot-pass-intent-extras-though-alarmmanager/18649849#18649849 –