how to get bitmap information and then decode bitmap from internet-inputStream?

background suppose i have an inputStream that was originated from the internet of a certain image file. i wish to get information about the image file and only then to decode it. it’s useful for multiple purposes, such as downsampling and also previewing of information before the image is shown. the problem i’ve tried to […]

How to implement onBackPressed() & intents in fragment?

I know that onBackPressed() is a method in activity but, I want to use the functionality in fragments such that when back button is pressed, it gets redirected to another activity via Intent. Is there any solution to this ? public class News_Events_fragment extends Fragment { ProgressDialog pd; ListView lv1; SharedPreferences sharedPreferences = null; int […]

Android drawable with parameters

Is it possible to have something like drawable/myshape.xml <shape xmlns:android=”” android:shape=”rectangle”> <solid android:color=”{0}” /> </shape> and then from java class take this drawable passing values for parameters. Something like Drawable myshape = ???.getDrawableWithParameters(R.drawable.myshape, 0x00ff00);

“Content has view with id attribute '' that is not a ListView Class.” when create a list view in a fragment

Here is the problem. I have a list view, and it looks fine in the building, but it broke the error. Content has view with id attribute ‘’ that is not a ListView Class. I haven’t added the listview into the XML, something like :@android:list, the reason I didn’t do that is I could find […]

ContentObserver for listening contact changes

I really don’t understand why content observer listens the changes which is not related with the contact info. I simply registered to the URI which I wanna listen the changes: getContentResolver().registerContentObserver(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, true, contactsObserver); But after calling someone or texting to someone, it triggers and calls onChange method in ContentObserver. So I need to re-sync all […]

isApplicationBroughtToBackground security feature misbehaves often

I am using this to implement a security feature that displays a locking screen if my app regains the focus after coming back from a different app. Now, the problem is that the security feature is sometimes shown twice. After digging around a bit I noticed that the topActivity from ActivityManager.getRunningTasks(1) is sometimes still the […]

KeyStore getEntry return null after change password

Hi I have a program that need store a key in the keystore, I generate a pair keys and I sign a value and this works perfectly all time. The problem comes when the user goes to preferences and changes the password or change the password mode to pin mode. After that, when I try […]

How to get Image Path just captured from camera

below is my code but is not give me image path in onActivity result Uri selectedImageUri = data.getData(); selectedImagePath = getPath(selectedImageUri); Log.w(“jay”, “Camera Image Path :” + selectedImagePath); Toast.makeText(MiscansOther_pannel.this, selectedImagePath, Toast.LENGTH_LONG).show();

how to show location pin of the visible portion of a mapview in android?

Here is my asynctask part where I am putting pin in some location parsed from an xml. This is doing fine for a small location data set but takes a long time when the location data set is large. private class MapLoader extends AsyncTask<Void, Void, Void> { ProgressDialog dialog; ArrayList<POI>[] mappoiList; @Override protected void onPreExecute() […]

Weird errors while animating (Adreno, GL)

I have two weird errors which sometimes appear when I animate my Views (with a little help of NineOldAndroids). It’s hard to debug so I’m not sure yet, but I think it may be caused by v.setLayerType(View.LAYER_TYPE_HARDWARE, null);. And there are some drawing issues which go together with this log, but they are not consistent. […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.