全部
我想在 list 中的启动器 Activity 中设置两个操作,如下所示,所以这是可能的。
<activity
android:name=".MainActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.example.sampleapp.android.widget.buttons.ButtonWidget.ACTION_WIDGET_CONFIGURE"/>
</intent-filter>
</activity>
这可能吗?
最佳答案
尝试使用多个 intent-filter 定义 action
<activity
android:name=".MainActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.example.sampleapp.android.widget.buttons.ButtonWidget.ACTION_WIDGET_CONFIGURE"/>
</intent-filter>
</activity>
关于android - 在启动器 Activity 中设置更多操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14453360/