Здравствуйте. Подскажите пожалуйста каким образом можно выпарсить из содержимого файла нужный кусок. Содержимое файла такого формата:
Нужно выпарсить содержимое между тегами <activity и </activity>, но только в том месте где между этими тегами есть строки
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Код:
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="@string/app_name" android:launchMode="singleTop" android:name="com.cmplay.tile2.ui.LoveShareActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.vungle.publisher.FullScreenAdActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:configChanges="keyboardHidden|orientation" android:exported="false" android:name="com.sina.weibo.sdk.component.WeiboSdkBrowser" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:name="com.google.android.gms.ads.AdActivity" android:theme="@android:style/Theme.Translucent"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize" android:name="com.inmobi.androidsdk.IMBrowserActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity"/>
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity"/>
<meta-data android:name="applovin.sdk.key" android:value="UdAAPq-zrVhcaaKovlmPEn8qXmrUnzGFbRP_FOz5uehTE0G7l0X-nfpJPepBc3QCVrClEAr7qWa2XsAHshGdM4"/>
<service android:exported="false" android:name="com.qq.e.comm.DownloadService"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.qq.e.ads.ADActivity"/>
<activity android:configChanges="orientation" android:exported="true" android:label="@string/app_name" android:name="com.cmplay.webview.ui.WebViewActivity" android:process=":web" android:screenOrientation="portrait"/>
<activity android:launchMode="singleTop" android:name="com.cmplay.tile2.ui.TipsGetGiftSuccedDialog" android:screenOrientation="portrait" android:theme="@style/dialog" android:windowSoftInputMode="adjustPan|stateHidden"/>
<provider android:authorities="com.cmplay.tiles2.ipc.web" android:exported="false" android:name="com.cmplay.webview.ipc.WebIpcProvider" android:process=":web"/>
<receiver android:exported="true" android:name="com.appsflyer.MultipleInstallBroadcastReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver android:exported="true" android:name="com.cmplay.tile2.CMCampaignTrackingReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver android:exported="true" android:name="com.cmplay.webview.broadcast.WebBroadcast" android:process=":web">
<intent-filter>
<action android:name="com.cmplay.webview.broadcast.webbroadcast"/>
</intent-filter>
</receiver>
<receiver android:exported="true" android:name="com.cmplay.webview.broadcast.GameBroadcast">
<intent-filter>
<action android:name="com.cmplay.webview.broadcast.gamebroadcast"/>
</intent-filter>
</receiver>
<receiver android:name="com.appsflyer.AppsFlyerLib">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
<receiver android:exported="true" android:name="com.cmplay.notification.EnergyReceiver" android:process=":service">
<intent-filter>
<action android:name="com.cmplay.notification.EnergyReceiver"/>
</intent-filter>
</receiver>
<receiver android:name="com.cmplay.receiver.InstallMonitorServiceReceiver" android:process=":service">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
<meta-data android:name="UMENG_APPKEY" android:value="55a86f6667e58e298100016b"/>
<meta-data android:name="UMENG_CHANNEL" android:value="gp"/>
<receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND" android:process=":service">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<category android:name="gcm.play.android.samples.com.gcmquickstart"/>
</intent-filter>
</receiver>
<service android:exported="false" android:name="com.cmplay.gcmPush.MyGcmListenerService" android:process=":service">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.cmplay.gcmPush.MyInstanceIDListenerService" android:process=":service">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service android:exported="false" android:name="com.cmplay.gcmPush.RegistrationIntentService" android:process=":service"/>
<meta-data android:name="android.app.lib_name" android:value="cocos2dcpp"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id"/>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="@string/app_name" android:launchMode="singleTop" android:name="com.cmplay.tile2.ui.AppActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="fb.me" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="piano2"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="@string/app_name" android:launchMode="singleTop" android:name="com.cmplay.tile2.ui.ShareActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:excludeFromRecents="true" android:label="@string/app_name" android:launchMode="singleInstance" android:name="com.cmplay.tile2.ui.GameProblemActivity" android:process=":service" android:screenOrientation="portrait" android:taskAffinity="com.gameproblem" android:theme="@style/dialog"/>
<activity android:configChanges="orientation" android:label="@string/app_name" android:name="com.cmplay.util.crop.CropImageActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<service android:name="com.cmplay.tile2.ui.ReportService" android:process=":service"/>
<receiver android:name="com.cmplay.receiver.InstallMonitorReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
<receiver android:exported="false" android:name="com.cmplay.util.ConnectionChangedReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<receiver android:enabled="true" android:name="com.cmplay.notification.NotificationDeleteReceiver" android:process=":service"/>
<provider android:authorities="com.cmplay.tiles2.ipc_provider" android:exported="false" android:name="com.cmplay.ipc.IpcProvider" android:process=":service"/>
<service android:exported="true" android:name="com.cmplay.tile2.export.DumpReportService" android:process=":crashReport"/>
<activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity" android:theme="@style/Theme.IAPTheme"/>
<activity android:exported="true" android:name="com.cmplay.tiles2_cn.wxapi.WXEntryActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:hardwareAccelerated="true" android:name="com.unity3d.ads.android.view.UnityAdsFullscreenActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<service android:name="com.cmplay.crashreport.CrashReportService" android:process=":crashReport"/>
<receiver android:name="com.cmplay.crashreport.WifiStateReceiver" android:process=":crashReport">
<intent-filter>
<action android:name="android.net.wifi.STATE_CHANGE"/>
</intent-filter>
</receiver>
<activity android:launchMode="singleTask" android:name="com.cmcm.picks.PicksLoadingActivity" android:taskAffinity="com.cmcm.adsdk.nativead" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTask" android:name="com.cmcm.adsdk.interstitial.PicksInterstitialActivity" android:screenOrientation="portrait" android:theme="@style/cm_interstital"/>
<activity android:launchMode="singleTask" android:name="com.cmcm.picks.webview.PicksBrowser" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>
<service android:exported="false" android:name="com.cmcm.picks.init.DownloadService" android:process=":PickService"/>
<activity android:launchMode="singleInstance" android:name="com.cmcm.picks.vastvideo.FullScreenVideoActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:launchMode="singleTask" android:name="com.cmcm.picks.vastvideo.IncentiveVideoPlayActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:excludeFromRecents="true" android:launchMode="singleInstance" android:name="com.cmcm.picks.vastvideo.VideoAdDetailActivity" android:screenOrientation="portrait" android:theme="@style/cm_interstital"/>
<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.facebook.ads.InterstitialAdActivity"/>
<activity android:configChanges="orientation|screenSize" android:name="com.facebook.notifications.internal.activity.CardActivity"/>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>