我正在開發一款工作完美的Android應用程序,如果我更改開關.LAUNCHER WITH .DEFAULT, 程序崩潰並且日誌中沒有顯示錯誤消息。 這是我在線上遵循一些指令後嘗試的。我的Android Manifest飛濺屏幕活動的問題
1.Download新gradle這個 2.Clean我的項目 3.Sync我gradle這個 所有這些事情沒有工作對我來說,請需要幫助。 package com.asimyaz.android.nilemssn;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class Splash extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent i =new Intent(Splash.this,MainActivity.class);
startActivity(i);
finish();
}
},10000);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_splash, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.asimyaz.android.nilemssn" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<application
android:allowBackup="true"
android:icon="@mipmap/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.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".bio"
android:label="@string/title_activity_bio" >
</activity>
<activity
android:name=".past_questions"
android:label="@string/title_activity_past_questions" >
</activity>
<activity
android:name=".my_web"
android:label="@string/title_activity_my_web" >
</activity>
<activity
android:name=".my_pdfRend"
android:label="@string/title_activity_pdf__renderer" >
</activity>
<activity
android:name=".Suggestion"
android:label="@string/title_activity_suggestion" >
</activity>
<activity
android:name=".Splash"
android:label="@string/title_activity_splash">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
可能重複的[如何獲取多個圖標以在一個應用程序中啓動不同的活動?](http://stackoverflow.com/questions/3270409/how-do-i-get-multiple-icons-to-launch -different-activities-in-one-application) –