关于settings设置修改问题,求大神搭救!!

桂仔很棒棒 桂仔很棒棒 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想在打开settings设置时,添加一个登陆界面(要求输入密码才能进入settings),同时在设置里面我要添加一栏可以修改密码的选项。 于是我写了一个登陆界面的class跟xml,我该如何才能加到settings的源码当中?
我写的class

protected void onCreate(Bundle savedInstanceState)
{
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.codefirst);
codeButton=(Button)findViewById(R.id.codego);
codeinputEditText=(EditText)findViewById(R.id.codepass);
codeButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setClass(Code.this, Settings.class);
startActivity(intent);
}
});


}
}


这是我修改AndroidManifest的布局:

<activity android:name="com.android.settings.Code">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>
</activity>

<!-- Settings -->

<activity android:name="Settings"
android:label="@string/settings_label_launcher"
android:taskAffinity="com.android.settings"
android:configChanges="keyboardHidden|screenSize|mcc|mnc"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.APP_SETTINGS" />
</intent-filter>
</activity>



mm的时候老是提示AndroidManifest错误?为什么呢?求大神指点
...全文
评论 8
收藏 已收藏
分享
返回顶部
桂仔很棒棒
Android 80,488 成员 91,371 内容