package islam.work;
import java.net.URI;
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.content.Intent;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class Tasbeeeee7_IslamicActivity extends Activity {
MediaPlayer begin;
Intent inti;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
begin = MediaPlayer.create(Tasbeeeee7_IslamicActivity.this , R.drawable.media);
begin.start();
Thread timer = new Thread(){
public void run(){
try {
sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
finally
{
startActivity(new Intent("islam.work.program"));//error here
}
}
};
timer.start();
}
}
答案 0 :(得分:2)
将finally
块更改为
finally
{
startActivity(new Intent(Tasbeeeee7_IslamicActivity.this,Program.class)); // where Program is second activity
}
将清单文件中的Program.java
添加为
<activity
android:label="Program"
android:name="islam.work.Program" >
</activity>
希望这有帮助。
答案 1 :(得分:1)
确保您已在清单中声明了自己的活动。大多数时候人们会忘记并花费无尽的时间来查看代码。
也尝试做这样的事情。
Intent intent = new Intent(this, DisplayMessageActivity.class);