“Exported activity does not require permission” when attempting to launch from a URI

I had the same issue when I updated SDK to version 20. I removed it adding android:exported propery: <activity android:name=”.MainActivity” android:exported=”false”> <intent-filter> <action android:name=”android.intent.action.VIEW” /> <data android:scheme=”http” android:host=”example.com” /> </intent-filter> </activity> inside the activity declaration in manifest. Of course you may specify this if the activity is intended only for application-internal use The reason it … Read more

How to write an URI string in App.Config

You haven’t properly encoded the ampersands in your URI. Remember that app.config is an XML file, so you must conform to XML’s requirements for escaping (e.g. & should be &amp;, < should be &lt; and > should be &gt;). In your case, it should look like this: <appSettings> <add key=”fooUriString” value=”https://foo.bar.baz/download/DownloadStream?id=5486cfb8c50c9f9a2c1bc43daf7ddeed&amp;login=null&amp;password=null” /> </appSettings> But in … Read more

Get Real Path For Uri Android

Use this code .This is working for all android version.This is tested code.This support all devices public static String getPathFromUri(final Context context, final Uri uri) { final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; // DocumentProvider if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { // ExternalStorageProvider if (isExternalStorageDocument(uri)) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = … Read more

Android notification setSound is not working

below code will help you: String CHANNEL_ID=”1234″; Uri soundUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + “://”+ getApplicationContext().getPackageName() + “/” + R.raw.mysound); NotificationManager mNotificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); //For API 26+ you need to put some additional code like below: NotificationChannel mChannel; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { mChannel = new NotificationChannel(CHANNEL_ID, Utils.CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH); mChannel.setLightColor(Color.GRAY); mChannel.enableLights(true); mChannel.setDescription(Utils.CHANNEL_SIREN_DESCRIPTION); AudioAttributes audioAttributes = new … Read more

java.net.MalformedURLException: no protocol on URL based on a string modified with URLEncoder

You need to encode your parameter’s values before concatenating them to URL. Backslash \ is special character which have to be escaped as %5C Escaping example: String paramValue = “param\\with\\backslash”; String yourURLStr = “http://host.com?param=” + java.net.URLEncoder.encode(paramValue, “UTF-8”); java.net.URL url = new java.net.URL(yourURLStr); The result is http://host.com?param=param%5Cwith%5Cbackslash which is properly formatted url string.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)