can't change default activate run first
I am still new on android area. I just what to change the default activite to run first. I what that my TestprActivity.java will run first instead. I know that it can be done by manifest file but I dont know how. my manifist file is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.News"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application 开发者_StackOverflowandroid:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="main.start" />
<activity android:name=".NewsActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".WebActivity"/>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
</manifest>
on run--->configuration I and find the wanted class to run first. please give an example how it can be done.
thanks!
The launcher activity of an application is defined by the respective intent filter
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Thus, you should add this filter to the activity you want. Note that only one activity should have this filter .
精彩评论