Remove background drawable programmatically in Android

I want to remove the background drawable (@drawable/bg) programmatically. Is there a way to do that? Currently, I have the following XML in my layout: <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout android:id=”@+id/widget29″ android:layout_width=”fill_parent” android:layout_height=”fill_parent” xmlns:android=”” android:background=”@drawable/bg”> </RelativeLayout>

Understanding Canvas and Surface concepts

I’m struggling to understand the process of drawing to SurfaceView and therefore the whole Surface/Canvas/Bitmap system, which is used in Android. I’ve read all articles and API documentation pages, which I was able to find on android-developers site, a few tutorials of android graphics, LunarLander source code and this question. Please tell me, which of […]

Where does Android store SQLite's database version?

I am unable to find where Android stores the database version within the SQLite database file. Where exactly is the database version stored?

Notification passes old Intent Extras

i am creating a notification inside a BroadcastReceiver via this code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.ic_stat_notification; CharSequence tickerText = “New Notification”; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); notification.defaults |= Notification.DEFAULT_VIBRATE; long[] vibrate = {0,100,200,200,200,200}; notification.vibrate = vibrate; notification.flags |= Notification.FLAG_AUTO_CANCEL; CharSequence contentTitle […]

How to resume Fragment from BackStack if exists

I am learning how to use fragments. I have three instances of Fragment that are initialized at the top of the class. I am adding the fragment to an activity like this: Declaring and initializing: Fragment A = new AFragment(); Fragment B = new BFragment(); Fragment C = new CFragment(); Replacing/Adding: FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); […]

View the Task's activity stack

I just started developing a simple Android application while I’m still learning the platform. I’m using Eclipse IDE with the ADT plugin 0.9.6. I need to know if it’s possible to view the Activity stack that is associated with a Task? Is there any way through the DDMS tool or through any other technique? Essentially […]

android.view.InflateException: Binary XML file: Error inflating class fragment

I have a very frustrating error that I cannot explain. I created an Android application that uses Android AppCompat to make it compatible with older versions. Here is my main activity layout file: < xmlns:android=”” xmlns:tools=”” android:id=”@+id/drawer_layout” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.MainActivity”> <!– As the main content view, the view below consumes the entire space available using […]

Get Android .apk file VersionName or VersionCode WITHOUT installing apk

How can I get programmatically version code or version name of apk from AndroidManifest.xml file after download and without installing it. <manifest xmlns:android=”” package=”” android:versionCode=”1″ android:versionName=”1.1″ > For example I want to check if a new version is uploaded on my IIS service after that install it on device, if not a new version I […]

Alternatives to PreferenceFragment with android-support-v4

I’ve come to a sudden halt in the development of my app as I realized that PreferenceFragments weren’t supported in this library. Are there any alternatives that a rookie android developer can use to overcome this obstacle ? This is my main window as of right now <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent”> […]

Decompile .smali files on an APK

This question already has an answer here: Is there a way to get the source code from an APK file? 13 answers

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