【问题标题】:How can I know or define main Activity (AIR for Android)我如何知道或定义主 Activity (AIR for Android)
【发布时间】:2012-04-14 20:19:20
【问题描述】:

我如何知道或定义由 AIR for Android 开发的应用程序的主要活动,我必须使用它来通过 Intent 启动

喜欢这个

Intent launchIntent = new Intent(Intent.ACTION_MAIN).addCategory("android.intent.category.LAUNCHER").setClassName("air.test.test.Test", "air.test.test.Test.Activity" ).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).addFlags(Intent.FLAG_FROM_BACKGROUND).setComponent(new ComponentName("air.test.test.Test", "air.test.test.Test.Activity"); getContext().startActivity(launchIntent);

【问题讨论】:

    标签: android flash air android-intent


    【解决方案1】:

    只需在manifest 上的activity 声明标签上添加intent filters,如下所示:

    <activity
                android:name=".activity.SplashActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
     </activity>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-21
      • 1970-01-01
      • 2017-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-12
      相关资源
      最近更新 更多