我是Android的新手,我正在开发Android的应用程序。我开发了一个空白活动的项目。
之后,我在layout文件夹中创建了一个User界面并保存为sign_up.xml。
之后,我在src目录中创建了一个类文件,其中我的代码如下:
import com.example.projectname.R;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
public class sign_Up_Activity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
super.onCreate(savedInstanceState);
setContentView(R.layout.sign_up);
}
}
我的AndroidManifest.xml
看起来像:
<activity android:name=".sign_Up_Activity" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
现在我正在运行应用程序,但它崩溃并收到错误。
提前谢谢。