我现在正面临一个问题。
我的代码看起来不错,但是我不明白为什么我的应用程序没有出现在模拟器上。
如果有人可以给我一些建议或回应
不胜感激,
谢谢 :)
我的 list :
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
</activity>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity
android:name=".Login"
android:label="@string/title_activity_login" >
</activity>
<activity
android:name=".Register"
android:label="@string/title_activity_register" >
</activity>
</application>
我的 Gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "blackbeardstudio.login_register"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
}
最佳答案
在 list 中,与某些 Activity 相关的意图过滤器必须位于该 Activity 的 Activity 块内。对于使用MainActivity
作为启动器 Activity 的实例(将出现在主屏幕上的应用程序启动器菜单中的实例):
<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>
关于android - Android App未出现在模拟器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33701263/