java - "No activity found to handle intent" error -
i'm beginning develop , tried following set of tutorials on youtube. got confused after trying follow tutorial 1.8.
what happens launch application (using emulator), opens application. goes splash.xml screen, background, 5 seconds. then, it's suppose go mainactivity.java screen, main screen. unfortunately, after showing 5 seconds of splash screen, tells me application has stopped.
androidmanifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.eduardopelaez.minecraftforums" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest>
splash.xml (which shown 5 seconds after opening application):
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/minecraft_wallpaperrepeating" android:orientation="vertical" > </linearlayout>
mainactivity.java (which suppose come after splash.xml, crashes):
package com.eduardopelaez.minecraftforums; import android.app.activity; import android.content.intent; import android.os.bundle; public class mainactivity extends activity { @override protected void oncreate(bundle travisisawesome) { super.oncreate(travisisawesome); setcontentview(r.layout.splash); thread logotimer = new thread() { public void run() { try { sleep(5000); intent menuintent = new intent( "com.eduardopelaez.minecraftforums.mainactivity"); startactivity(menuintent); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } { finish(); } } }; logotimer.start(); } @override public boolean oncreateoptionsmenu(android.view.menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } }
intent menuintent = new intent( mainactivity.this, mainactivity.class); startactivity(menuintent);
Comments
Post a Comment