![](/img/trans.png)
[英]Android start main activity when another activity is called by broadcast
[英]android how to start the main activity when I am on another activity
我正在signin
活動,如果用戶點擊按鈕,我想開始主要活動。 這是主要活動welcome
的主要活動
<activity
android:name=".Welcome"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
我試過這樣的
Intent welcomeIntent =new Intent("android.intent.action.MAIN");
startActivity(welcomeIntent);
但我有一個屏幕說complete acting using
與許多choese一起complete acting using
,什么是解決方案pelase?
改變你的意圖直接啟動你的課程
Intent welcomeIntent = new Intent(context, Welcome.class);
startActivity(welcomeIntent);
如果您正在使用this
活動替換context
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.