我已經創建完成後我自己的應用項目類:Android的工作室默認的活動
package com.example.bezzabarovaa.myapplication;
import android.app.Application;
import android.content.Context;
/**
* Created by bezzabarovaa on 04.08.2017.
*/
public class app extends Application {
public static Context context;
@Override public void onCreate() {
super.onCreate();
context = getApplicationContext();
}
}
,並更改的manifest.xml(應用程序改變到App類)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.bezzabarovaa.myapplication">
<app
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
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" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</app>
我已收到消息Error running Unnamed:Default Activity not found
如果我會改變e我的班級app
返回到清單文件中的application
- 一切正常。 問題在哪裏? 謝謝。
你的活動在哪裏? – SripadRaj
是什麼讓你覺得你可以改變標籤名稱,它不會破壞? –
您無法更改標籤名稱!你應該使用'>'並且遵循Java指南,其中類名應該是CamelCase(不是應用程序,而是應用程序)。 –
shimatai