android,android-layout,android-view,android-button,android-background
Have you tried to use Button's style like this. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="?android:attr/buttonStyle" android:id="@+id/linlay_add_category_area_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:orientation="horizontal" android:padding="13dp"> ... </LinearLayout> ...
android,android-layout,bitmap,android-background
To point out, image file size don't effect memory usage. It depend on the image specs: width x height x 1 byte. You shouldn't set splash screen image in code by scaling it depending on screen resolution. The drawable folders are there to do that. Provide a different image with...
android,database,sqlite,android-intent,android-background
Try to start service in separate process using android:process=":servicename" in AndroidManifest.xml. If service is running in another process, it wouldn't be killed with activity.
java,android,android-background
It sounds like you want a notification to be posted to the notification bar. If so I advise using an alarm. However, chances are if this is days in the future, the phone may be shut off. So you should store when the alarm should go off, create a Broadcast...
android,android-intent,android-activity,android-background,android-wallpaper
Try clearing your wallpaper before setting a new one : private void doStuff(Intent myIntent){ ... for (int i = 0; i < File_Array.size(); i++) { Bitmap bitmap = BitmapFactory.decodeFile(File_Array.get(i)); try { myWallpaper.clear(); myWallpaper.setBitmap(bitmap); } catch (IOException e) { e.printStackTrace(); } or try using the Method myWallpaper.forgetLoadedWallpaper(); (Min API 14)...
android,android-layout,android-background
Exactly as I thought your content indicators are incorrect (unless you wanna introduce such a content padding with your 9-patch). Try this instead: Right and bottom guides, determine which part (or how much) of your drawable should be occupied by your content. You've set this region to really small space,...
android,android-intent,android-activity,android-background
Use this code for that.. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) { // Activity was brought to front and not created, // Thus finishing this will get us to the last viewed activity finish(); return; } // Regular activity creation code... } This...
android,service,broadcastreceiver,android-service,android-background
You may run the service in the foreground using startForeground(). A foreground service is a service that's considered to be something the user is actively aware of and thus not a candidate for the system to kill when low on memory. But bear in mind that a foreground service must...
android,performance,android-intent,android-activity,android-background
Since there is no real question asked here, I Will give an answer that seems suiting to your problem. First you need to use Asyntasks, then after you treated the response you should do something like getting the instance of your database and calling the right Insertion method by passing...
java,android,multithreading,android-asynctask,android-background
Just use AsyncTask. If you look into the source code of AsyncTask, you'll find AsyncTask just uses ThreadPoolExecutor and Handler....
java,android,android-service,android-background,android-service-binding
So after doing some digging I think I have come up with an (as yet) untested solution. Firstly, based on Diane's suggestion here: https://groups.google.com/forum/#!topic/android-developers/Nb58dOQ8Xfw I should be binding to the application context - so my problem of losing the context is gone - I can maintain my ServiceConnection across configuration...
java,android,android-activity,android-service,android-background
You need to add TimerTask, see how to do that here
For downloading data, you might use the DownloadManager service. More generally speaking, you could use IntentService as a fairly simple alternative to AsyncTask. One downside is it doesn't come with a built-in way to transport data to the Main Thread. You might use a Handler or the LocalBroadcastManager for this...
android,android-listview,listviewitem,android-background
Set ListView parent background with any drawable asset and listView background transparent then in listViewAdapter you have to item background transparent with 9patch image at wrapContent Width parameter of textView in listItem.
android,android-lifecycle,android-notification-bar,android-background
The solution that seems to keep the service/notification running is to use a repeating alarm: public void startAlarm(){ alarmMgr = (AlarmManager)this.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(this, NotificationService.class); alarmIntent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); alarmMgr.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 200*1000, alarmIntent); } I am not certain of the optimum frequency for resetting the alarm,...