Solutions

Solutions for different problems, might not contain code

Solutions, Tutorial

ListView Empty Message

When I first needed to set a message on a ListView that was empty, I tried different methods, but none of them worked, except the one that I will describe in this tutorial. So let’s start. When you want to show a message to the user when the ListView is empty, you have to keep

Snippets, Solutions

Errors after update to Android Studio 0.8

I have just updated my Android Studio to Android Studio 0.8.2. But, after the update I kept getting these 3 errors while I was trying to run my project: 1.  First error Error:Execution failed for task > java.io.FileNotFoundException: C:\Program Files (x86)\Android\android-studio\sdk\tools\proguard\proguard-android-optimize.txt (The system cannot find the path specified) 2. Second error (this happened only after the

, ,
Snippets, Solutions

Share image Intent

Whenever you need to share an image from the external storage you can use the startActivity method and an Intent to do that. Doing so, the user will be able to chose whatever app he likes to share the photo. Intent share = new Intent(Intent.ACTION_SEND); share.setType(“image/png”); share.putExtra(Intent.EXTRA_STREAM, Uri.parse(“file:///”+imagePath)); startActivity(Intent.createChooser(share, “Share Image”)); If you don’t append the

, , ,
Solutions

Android Studio Gradle 0.9 error: Unable to load class ‘com.android.builder.testing.api.DeviceProvider’

I had to re-install my windows, therefore I had to re-install all my programs too, including Android Studio :) So, after I had re-installed Android Studio, I kept getting a Gradle error: ” Unable to load class ‘com.android.builder.testing.api.DeviceProvider’”. After I googled it I found the solution here. It seems that we have to delete gradle’s cache.

,
Snippets, Solutions

Android: Prevent cut-copy-paste popup to be displayed

If you ever need to disable the popup for cut-copy-paste when you long tap a text from an edit text you can do this by using the code below: yourEditText.setCustomSelectionActionModeCallback(new Callback() { public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } public void onDestroyActionMode(ActionMode mode) { } public boolean onCreateActionMode(ActionMode mode, Menu menu) {

, , , , ,
sponsored
Exit mobile version