Android FATAL EXCEPTION MAIN: java.lang.RuntimeException: Unable to start activity ComponentInfo

后端 未结 5 1366
感动是毒
感动是毒 2021-01-19 02:40

I am nubie at programming android and I know here on fourm is a lot of pages discrabing solution for my problem, but now I lose 2 days in still don\'t get the solution. Plea

相关标签:
5条回答
  • 2021-01-19 03:12

    Solution 1: Try cleaning your project,restarting eclipse. Solution 2: Check manifest file. Solution 3: Check if the tag and tag in the manifest file match upto the correct location of the activity.

    It would help if you can post your code.

    0 讨论(0)
  • 2021-01-19 03:15

    Your activity name is WifiScan but you have declared it as .activity_wifi_scan change it and try again.

    Change the <activity> element to:

    <activity android:name=".WifiScan">
             <intent-filter>
                     <action android:name="android.intent.action.MAIN"></action>
                     <category android:name="android.intent.category.LAUNCHER"></category>
                     <data />
             </intent-filter>
         </activity>
    
    0 讨论(0)
  • 2021-01-19 03:21

    try to add your activity com.example.wifiscan.activity_wifi_scan to your AndroidManifest.xml

    0 讨论(0)
  • 2021-01-19 03:27

    You did not initialise your activity in your manifest file

    0 讨论(0)
  • 2021-01-19 03:32

    I was having this error and after hours of searching I've came out it was my mistake (Oh! But this is impossible! LOL).

    The problem for me was that I've added the android:theme="@style/Theme.appcompat.Light" to the layout XMLs instead of the app manifest.

    As soon I've removed the atributes from the layouts and replaced the one on the manifest everything worked like expected.

    0 讨论(0)
提交回复
热议问题