Android app opens in old app when shareing file - android

I have kind of a wierd problem. I have setup my app to be the default launcher for opening files, in the manifest, like the code sample below.
For example if I chose to open a file from the default android download app it looks like this:
Is there a way to let it open in a new app/window such that the download app and my app looks like being two different apps?
MANIFEST FILE
<activity
android:name=".SplashActivity"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="sensorPortrait">
<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" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/pdf" />
<data android:mimeType="text/plain" />
<data android:mimeType="application/rtf" />
<data android:mimeType="image/jpeg" />
<data android:mimeType="image/png" />
<data android:mimeType="image/tiff" />
<data android:mimeType="image/bmp" />
<data android:mimeType="image/gif" />
<data android:mimeType="application/postscript" />
<data android:mimeType="application/msword" />
<data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
<data android:mimeType="application/vnd.ms-powerpoint" />
<data android:mimeType="application/vnd.ms-excel" />
<data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
</intent-filter>
</activity>
Complete manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="princh.princh">
<uses-permission android:name="android.permission.INTERNET" />
//Allows the app to use the internet connection
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
//Allows the app to check the connection status in order to determine whether data can be downloaded.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
//Allows the app to cache map tile data in the device's external storage area.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
//Allows the app to use WiFi or mobile cell data (or both) to determine the device's location.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
//Allows the app to use the Global Positioning System (GPS) to determine the device's location to within a very small area.
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#mipmap/princh_launcher_icon"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyD1e3EbexMClXfkyULNViJlOPgeubzZdfI" />
<service
android:name=".network.NetworkManager"
android:exported="false" >
</service>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="sensorPortrait" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".PrintJobActivity"
android:label="#string/app_name"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name=".SelectPrinterOptionsActivity"
android:label="#string/title_activity_select_printer_options"
android:launchMode="singleTop"
android:parentActivityName=".PrintJobActivity"
android:screenOrientation="sensorPortrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".PrintJobActivity" />
</activity>
<activity
android:name=".PrintRangeActivity"
android:label="#string/title_activity_print_range"
android:parentActivityName=".PrintJobActivity"
android:screenOrientation="sensorPortrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".PrintJobActivity" />
</activity>
<activity
android:name=".ShowPrinterMapActivity"
android:label="#string/title_activity_select_printer_map"
android:parentActivityName=".SelectPrinterOptionsActivity"
android:screenOrientation="sensorPortrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SelectPrinterOptionsActivity" />
</activity>
<activity
android:name=".PrintPreviewActivity"
android:label="#string/title_activity_print_preview"
android:parentActivityName=".SelectPrinterOptionsActivity"
android:screenOrientation="sensorPortrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SelectPrinterOptionsActivity" />
</activity>
<activity
android:name=".OrderInfoActivity"
android:label="#string/title_activity_order_info_activitty"
android:screenOrientation="sensorPortrait">
</activity>
<activity
android:name=".PaymentActivity"
android:label="#string/title_activity_payment"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity
android:name=".OrderDetailsActivity"
android:label="#string/title_activity_order_details"
android:screenOrientation="sensorPortrait">
</activity>
<activity android:name="sdt.brc.android.BarcodeScanActivity"
android:label="#string/app_name">
<intent-filter>
<category android:name="android.intent.category.EMBED" />
</intent-filter>
</activity>
<activity
android:name=".TermsAndConditionsActivity"
android:label="#string/title_activity_terms_and_conditions"
android:screenOrientation="sensorPortrait">
</activity>
<activity
android:name=".SplashActivity"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="sensorPortrait"
android:process=":PrinchProcess">
<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" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/pdf" />
<data android:mimeType="text/plain" />
<data android:mimeType="application/rtf" />
<data android:mimeType="image/jpeg" />
<data android:mimeType="image/png" />
<data android:mimeType="image/tiff" />
<data android:mimeType="image/bmp" />
<data android:mimeType="image/gif" />
<data android:mimeType="application/postscript" />
<data android:mimeType="application/msword" />
<data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
<data android:mimeType="application/vnd.ms-powerpoint" />
<data android:mimeType="application/vnd.ms-excel" />
<data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
</intent-filter>
</activity>
<activity
android:name=".JobStatusActivity"
android:label="#string/title_activity_job_status"
android:screenOrientation="sensorPortrait">
</activity>
<activity
android:name=".ShowReceiptActivity"
android:label="#string/title_activity_show_receipt"
android:screenOrientation="sensorPortrait">
</activity>
<activity
android:name=".QRCodeReaderActivity"
android:label="#string/title_activity_qrcode_reader"
android:screenOrientation="sensorPortrait">
</activity>
<activity
android:name=".PrintjobHistoryActivity"
android:label="#string/title_activity_printjob_history"
android:screenOrientation="sensorPortrait">
</activity>
</application>
</manifest>

Add the documentLaunchMode attribute to your Manifest. The default value is none, you probably want to use intoExisting, or always.
You can also take a look at allowTaskReparenting, and taskAffinity for fined control over the tasks and the stack.

Related

Android 12 Exported True not showing notifications in the notification bar

I had to modify my app for Android 12. The app now runs and notifications come but only within the app itself, prior to this they would be in the notification bar. I fixed areas where it needed the android:exported="true" so it would launch on Android 12. But I'm not getting notifications in the notification bar. Could someone help me point out where I've not added the exported rule or if theres something else I need to do ?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spliceystudios.apps.esf"
xmlns:tools="http://schemas.android.com/tools">
<queries>
<package android:name="com.google.android.apps.maps" />
</queries>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/> <!-- BroadcastReceiver permission to listen to the network -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-feature
android:name="android.hardware.location"
android:required="true" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="true" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<application
android:name="com.spliceystudios.apps.esf.AppController"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="#xml/network_security_config"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon,android:theme,android:supportsRtl"
>
<activity
android:name="com.spliceystudios.apps.esf.activities.ReportIssueActivity"
android:label="#string/title_activity_report_issue"
android:theme="#style/AppTheme.NoActionBar"></activity>
<uses-library
android:name="org.apache.http.legacy"
android:required="false" /> <!-- Goolge Maps API Key -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/map_api_key0" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/ad_app_id" />
<service android:name="com.spliceystudios.apps.esf.push_notification_firebase.FirebaseMessagingServiceIns"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="com.spliceystudios.apps.esf.push_notification_firebase.FirebaseInstanceIDService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent"
/>
<receiver android:name="com.spliceystudios.apps.esf.dtmessenger.DCMBroadcastReceiver"
android:exported="true">
<intent-filter>
<action
android:name="android.net.conn.CONNECTIVITY_CHANGE"
tools:ignore="BatteryLife" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
</intent-filter>
</receiver>
<activity
android:name="com.spliceystudios.apps.esf.activities.IntroSliderActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.MessengerActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.ReviewsActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.OffersListActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.ListUsersActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.InboxActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wuadam.awesomewebview.AwesomeWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"
android:theme="#style/FinestWebViewTheme.Light" />
<activity
android:name="com.spliceystudios.apps.esf.activities.MainActivity"
android:configChanges="uiMode"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.MapDirectionActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.MapStoresListActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.AboutActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.ProfileActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.CategoriesActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.ListStoresActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.EventsListActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.StoresListActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.PeopleListActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.CustomSearchActivity"
android:screenOrientation="portrait" />
<activity
android:exported="true"
android:name="com.spliceystudios.apps.esf.activities.SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.spliceystudios.apps.esf.activities.SettingActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.SliderActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.GalleryActivity"
android:screenOrientation="portrait" />
<activity
android:exported="true"
android:name="com.spliceystudios.apps.esf.activities.OfferDetailActivity"
android:screenOrientation="portrait">
<intent-filter android:label="#string/_DP_OFFER_MESSAGE">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_OFFER"
android:scheme="nsapp" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_OFFER"
android:scheme="http" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_OFFER"
android:scheme="https" />
<!-- WITH INDEX -->
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_OFFER_INDEX"
android:scheme="nsapp" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_OFFER_INDEX"
android:scheme="http" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_OFFER_INDEX"
android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name="com.spliceystudios.apps.esf.activities.StoreDetailActivity"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter android:label="#string/_DP_STORE_MESSAGE">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_STORE"
android:scheme="nsapp" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_STORE"
android:scheme="http" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_STORE"
android:scheme="https" />
<!-- WITH INDEX -->
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_STORE_INDEX"
android:scheme="nsapp" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_STORE_INDEX"
android:scheme="http" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_STORE_INDEX"
android:scheme="https" />
<!-- note that the leading "/" is required for pathPrefix -->
</intent-filter>
</activity>
<activity
android:name="com.spliceystudios.apps.esf.activities.EventDetailActivity"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter android:label="#string/_DP_EVENT_MESSAGE">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_EVENT"
android:scheme="nsapp" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_EVENT"
android:scheme="http" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_EVENT"
android:scheme="https" />
<!-- note that the leading "/" is required for pathPrefix -->
<!-- WITH INDEX -->
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_EVENT_INDEX"
android:scheme="nsapp" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_EVENT_INDEX"
android:scheme="http" />
<data
android:host="#string/_DP_HOST_NAME"
android:pathPrefix="#string/DP_PATH_PREFIX_EVENT_INDEX"
android:scheme="https" />
</intent-filter>
</activity> <!-- Version 2.0 activities -->
<activity
android:name="com.spliceystudios.apps.esf.activities.V2MainActivity"
android:configChanges="uiMode"
android:label="#string/title_activity_v2_main"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name="com.spliceystudios.apps.esf.activities.CustomSearchActivity$LoginActivityV2"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.CustomSearchActivity$ResultFilterActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.customView.AdvancedWebViewActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.customView.PaymentWebViewActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.booking.views.activities.ServiceOptionsActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.booking.views.activities.BookingCheckoutActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.booking.views.activities.BookingListActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.booking.views.activities.BookingDetailActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.spliceystudios.apps.esf.activities.FindMyPlaceActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
In your FirebaseMessagingServiceIns / MESSAGING_EVENT section, change the exported value to false
<service android:name="com.spliceystudios.apps.esf.push_notification_firebase.FirebaseMessagingServiceIns"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
and it'll match the guidelines on the Firebase website https://firebase.google.com/docs/cloud-messaging/android/client

App icon does not display in applications (on home screen)

My app used to work just fine, its icon displayed when installed in applications and it was uploaded to the Play Store. Now when I install it, it is like invisible, and in the Play Store it just says Uninstall, not open. What would be the reason for this?
Thanks.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="redacted" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:screenOrientation="portrait"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
>
<activity
android:name=".aboutclass"
android:configChanges="orientation|screenSize"
android:label="#string/app_name" >
<intent-filter>
<action android:name="redacted.aboutclass" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="redacted.MainActivity" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>
</manifest>
This problem occurs when you include the <data> element in the same intent-filter as your action.MAIN, which does not expect any data.
You could try splitting the intent-filter like this:
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="redacted.MainActivity" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
See this previous answer.

Android App not properly refactoring package

I had to refactor my app package name so I can re-upload my app to the store. (Took it down for a lost keystore). The app package was changed from com.maskyn.marlonjonescodus to com.maskynorig.codusmarlonjones. The Manifest file shows the refactor and so does all of the rest of the code, but when I run the app, the Logcat shows the old package name. It is also shown when I try to upload the app. What is causing this? I have tried cleaning, invalidating, and re-refactoring and nothing has worked. Here is my manifest file:
`
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Codus"
android:hardwareAccelerated="true"
android:largeHeap="true"
android:supportsRtl="true"
android:name="sharedcode.turboeditor.application.MyApp"
>
<!-- android:alwaysRetainTaskState="true" -->
<activity
android:name="com.maskynorig.codusmarlonjones.HomeActivity"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:launchMode="singleTop"
android:windowSoftInputMode="stateUnspecified|adjustResize"
android:theme="#style/AppThemeEditorDark">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="text/*" />
<data android:pathPattern="*.txt" />
<data android:pathPattern="*.html" />
<data android:pathPattern="*.css" />
<data android:pathPattern="*.js" />
<data android:pathPattern="*.md"/>
<data android:pathPattern="*.php" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name="sharedcode.turboeditor.activity.SelectFileActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/open_a_file"
android:parentActivityName="com.maskynorig.codusmarlonjones.HomeActivity"
android:theme="#style/AppThemeBaseLight">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.maskynorig.codusmarlonjones.HomeActivity" />
</activity>
<activity
android:name="sharedcode.turboeditor.preferences.ExtraSettingsActivity"
android:label="#string/extra_options"
android:parentActivityName="com.maskynorig.codusmarlonjones.HomeActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.maskynorig.codusmarlonjones.HomeActivity" />
</activity>
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true" />
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W"
android:value="632.0dip" />
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H"
android:value="598.0dip" />
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W"
android:value="632.0dip" />
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
android:value="598.0dip" />
</application>
`
I have found the problem. While searching, the Gradle still used the old name. Anyone who sees this, check that.

Implicit intent is not called in android

Here is my android manifest file:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".view.MainActivity"
android:label="#string/app_name"
android:screenOrientation="reverseLandscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data
android:host="mocha"
android:path="/RTT/reset"
android:scheme="content" />
</intent-filter>
</activity>
<activity
android:name="ihpc.mocha.fakertt.view.SessionTimeOutActivity"
android:label="#string/app_name"
android:screenOrientation="reverseLandscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="mocha"
android:path="/RTT/sessionTimeOut"
android:scheme="content" />
</intent-filter>
</activity>
</application>
It shows that I have registered implicit intent here
<data android:host="mocha"
android:path="/RTT/reset"
android:scheme="content" />
Now when I call it from another app
Intent gameInfoIntent = new Intent(Intent.ACTION_VIEW);
gameInfoIntent.setData(Uri.parse("content://mocha/RTT"
+ "/reset"));
gameInfoIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager
.queryIntentActivities(gameInfoIntent, 0);
boolean isIntentSafe = activities.size() > 0;
if (isIntentSafe) {
startActivity(gameInfoIntent);
finish();
} else {
}
It is showing no activity found for
"content://mocha/RTT/reset"
I tried calling this code form same activity as well for testing purpose but result is same.
Please suggest me where and what I am doing wrong?
UPDATE:
I am able to call session time out activity by putting suggested code in the comments.
I have updated my manifest like this:
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="mocha"
android:path="/RTT/reset"
android:scheme="content" />
</intent-filter>
</activity>
<activity
android:name="ihpc.mocha.fakertt.view.SessionTimeOutActivity"
android:label="#string/app_name"
android:screenOrientation="reverseLandscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="mocha"
android:path="/RTT/sessionTimeOut"
android:scheme="content" />
</intent-filter>
</activity>
</application>
But I am still unable to call main activity.
I have resolved my problem by adding below lines to my manifest file
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
Here is my new look manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ihpc.mocha.rtt"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="12" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name="ihpc.mocha.rtt.MainScene"
android:label="#string/app_name"
android:screenOrientation="reverseLandscape" >
<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" />
<data
android:host="mocha"
android:path="/RTT/reset"
android:scheme="content" />
</intent-filter>
</activity>
<activity
android:name="ihpc.mocha.rtt.SessionTimeOutActivity"
android:label="#string/app_name"
android:screenOrientation="reverseLandscape" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="mocha"
android:path="/RTT/sessionTimeOut"
android:scheme="content" />
</intent-filter>
</activity>
</application>
</manifest>
Hope this will help other developers as well !!!

Why is the "share-to" menu item gone in Android 4.0.3 PHONE HTC OneX

UPDATE
So far this only happens on the HTC OneX using Android 4.0.3
I have two share-to menu items in the android share menu.
When the user shares an image from android gallery, my app displays two
icons so user can have easy access to two different part of my app.
See picture.
This works fine in API v8, but in API v15 on a real device one of them is missing. API v15 emulator is ok!
In my AndroidManifest.xml this two Activity's set an icon in the share menu.
- ActivityMainLauncher
- ActivityQuickLauncher
The images are places in the hdpi, mdpi, ldpi folders.
The size is 72,48,36 pixels and they are PNG images.
Photoshop shows same resolution 72,009 for all three images.
UPDATE
added drawable-xhdpi folder for 96pix, but I have still only one item the: "SPRiiD"
This behavior is so strange, I don't know where to start debug.
I think there is something new in the API v15 that I have overseen?
Image of emulator API v15 correctly showing the two choices.
This is my AndroidManifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="internalOnly"
package="com.carlsberg.dumbo"
android:versionCode="12"
android:versionName="0.83" >
<!-- android:versionCode as the basis for identifying the application internally and handling updates, -->
<!-- android:versionName to users as the application's version -->
<permission
android:name="com.carlsberg.dumbo.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<supports-screens android:anyDensity="true" />
<uses-permission android:name="com.carlsberg.dumbo.permission.C2D_MESSAGE" />
<!-- <uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission> -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
</uses-permission>
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/launcher_gallery"
android:label="#string/string_app_name" >
<activity
android:name=".ActivityMainLauncher"
android:configChanges="keyboardHidden|orientation"
android:icon="#drawable/launcher_gallery"
android:label="#string/string_app_name"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity-alias
android:name="com.android.internal.app.ResolverActivity"
android:exported="true"
android:targetActivity=".ActivityMainLauncher" />
<activity
android:name=".gallery.ActivityGallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:configChanges="orientation|keyboardHidden"
android:icon="#drawable/launcher_gallery"
android:label="#string/string_app_name_gallery"
android:launchMode="singleTop"
android:taskAffinity="com.carlsberg.dumbo.GalleryActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityQuickLauncher"
android:configChanges="keyboardHidden|orientation"
android:icon="#drawable/launcher_gallery"
android:label="#string/string_app_name_quick_launcher"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
</activity>
<activity
android:name=".send.ActivitySend"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".ActivityRemoveFriend"
android:configChanges="keyboardHidden|orientation"
android:label="#string/string_app_name"
android:theme="#android:style/Theme.Dialog" >
</activity>
<activity
android:name="com.carlsberg.dumbo.history.TabActivityHistoryLauncher"
android:label="#string/string_app_name"
android:launchMode="singleTask" >
</activity>
<activity android:name="com.carlsberg.dumbo.history.ActivityTabGroup1" >
</activity>
<activity android:name="com.carlsberg.dumbo.history.ActivityTabGroup2" >
</activity>
<activity android:name="com.carlsberg.dumbo.history.ActivityHistoryOutgoing" >
</activity>
<activity android:name="com.carlsberg.dumbo.history.ActivityHistoryIncoming" >
</activity>
<activity
android:name=".ActivityLogin"
android:configChanges="keyboardHidden|orientation"
android:label="#string/string_app_name"
android:theme="#android:style/Theme.Dialog" >
</activity>
<activity
android:name=".ActivityAddFriend"
android:configChanges="keyboardHidden|orientation"
android:label="#string/string_app_name"
android:theme="#android:style/Theme.Dialog" >
</activity>
<activity
android:name=".ActivityAcceptFriend"
android:configChanges="keyboardHidden|orientation"
android:label="#string/string_app_name"
android:theme="#android:style/Theme.Dialog" >
</activity>
<activity android:name=".Preferences" >
</activity>
<activity
android:name=".send.TabActivityActivityHelpSend"
android:launchMode="singleTask"
android:screenOrientation="portrait" >
</activity>
<service
android:name=".IntentServiceSendFiles"
android:label="#string/string_sendFileService" >
</service>
<service
android:name=".IntentServiceGetFilesFromPc"
android:label="#string/string_getFileService" >
</service>
<service
android:name=".IntentServiceGetFiles"
android:label="#string/string_getFileService" >
</service>
<service
android:name=".ServiceBootCompleated"
android:label="#string/string_batchtester" >
</service>
<service
android:name=".IntentServiceGetFriendList"
android:label="#string/string_listupdater" >
</service>
<service
android:name=".IntentServiceUpdateFriendList"
android:label="#string/string_listupdater" >
</service>
<service android:name=".C2DMReceiver" />
<receiver
android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receive the actual message -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.carlsberg.dumbo" />
</intent-filter>
<intent-filter>
<!-- Receive the registration id -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.carlsberg.dumbo" />
</intent-filter>
</receiver>
<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver" >
<!-- Handle retry events -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RETRY" />
<category android:name="com.carlsberg.dumbo" />
</intent-filter>
</receiver>
<receiver android:name=".AlarmReceiver" >
</receiver>
<receiver android:name=".myBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<provider
android:name=".contentprovider.UserContentProvider"
android:authorities="com.carlsberg.dumbo.contentprovider" >
</provider>
</application>
I just copied the relevant part of your manifest and created a test project:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityMainLauncher"
android:configChanges="keyboardHidden|orientation"
android:icon="#drawable/ic_launcher"
android:label="#string/string_app_name"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityQuickLauncher"
android:configChanges="keyboardHidden|orientation"
android:icon="#drawable/ic_launcher"
android:label="#string/string_app_name_quick_launcher"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="text/*" />
<data android:mimeType="application/*" />
</intent-filter>
</activity>
</application>
</manifest>
Simple activity implementations:
public class ActivityQuickLauncher extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toast.makeText(this, getClass().getName(), Toast.LENGTH_LONG).show();
}
}
public class ActivityMainLauncher extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toast.makeText(this, getClass().getName(), Toast.LENGTH_LONG).show();
}
}
And it works:
Android 4.1.1 (Galaxy Nexus) and Android 4.0.3 (Archos G9 A70).

Categories

Resources