110,534
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="1" android:versionName="1.0.0" package="com.android.test1"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/logo" android:name="TestApplication" android:debuggable="false" android:taskAffinity="com.android.test1">
<activity android:theme="@style/ContentOverlay" android:name="SwitchUser" android:exported="true" android:configChanges="keyboardHidden|orientation" android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="com.android.test1.intent.action.USER_SWITCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:theme="@style/ContentOverlay" android:name="UserTest1AttentionFansList" android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="com.android.test1.intent.action.BLOG_DELETE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:name="SplashActivity" android:alwaysRetainTaskState="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /><!--查找此节点-->
</intent-filter>
</activity>
</application>
</manifest>
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\test.xml");
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
nsmgr.AddNamespace("android", "http://schemas.android.com/apk/res/android");
XmlNode node = doc.SelectSingleNode("//category[@android:name='android.intent.category.LAUNCHER']", nsmgr);
XmlNode parent = node.ParentNode;
parent.RemoveChild(node);
doc.Save(@"C:\test.xml");
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\test.xml");
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
nsmgr.AddNamespace("android", "http://schemas.android.com/apk/res/android");
XmlNodeList nodelist = doc.SelectNodes("//category[@android:name='android.intent.category.DEFAULT']", nsmgr);
foreach(XmlNode node in nodelist)
{
XmlNode parent=node.ParentNode;
parent.RemoveChild(node);
}
doc.Save(@"C:\test.xml");