I want to set a delay between the command between changing background. I tried using a thread timer and tried using run and catch. But it isn’t working. I tried this But it is only getting changed to black. Answer Try this code:
Tag: android
Android ProGuard settings for Facebook
I finally found out why my app crashes built for release. ProGuard was indeed stripping code from my application but i prevented this by manually adding the classes with the keep command in the proguard-android.txt (found in the sdk). For Facebook I used: But I think I’m still missing something. The app is crash free now but I can’t log
Get index of enum from string?
I have a string value, I also have an array of strings and an enum containing the range also. To get the index of the string in the array, from the value supplied I write this: How do I do this for an enum? Can I use ordinal? Or do i have to make my own method? The method might
How parse 2013-03-13T20:59:31+0000 date string to Date
How to parse this format date string 2013-03-13T20:59:31+0000 to Date object? I’m trying on this way but it doesn’t work. I get this exception from the first line: java.lang.IllegalArgumentException: Illegal pattern character ‘T’ Answer DateFormat df = new SimpleDateFormat(“yyyy-MM-dd’T’hh:mm:ssZ”); Year is lower case y. Any characters that are in the input which are not related to the date (like the
API service works every second request
I have problem with jax-rs REST service. Service does not operate properly. Every second request service throw me exception: HTTP Status 500 – could not execute query type Exception report message …
spannable on android for textView
I’m setting twitter data in my Android application. I want to make the font bold and italic using Spannable but it does not work, giving an error. How can I do it? Answer I want to make the font bold and ıtalic with spannable for this u will need to make o.content text as SpannableString then set it to TextView
Android: how to give bulletpoints, line break to text in textview
i have a textview with large text in it, but i want to give bulletpoints, line breaks , i tried placing xml entities like • for bullet point in my string.xml, but unable to get linebreak and few text comes in the middle, i like to use justify too it kind of works but I am unable to use justify
How to remove a task from ScheduledExecutorService?
I have a ScheduledExecutorService that times a few different task periodically with scheduleAtFixedRate(Runnable, INIT_DELAY, ACTION_DELAY, TimeUnit.SECONDS); I also have a different Runnable that I’m using with this scheduler. the problem starts when I want to remove one of the tasks from the scheduler. Is there a way to do this? Am I doing the right thing using one scheduler for
Retrieve Context from a fragment
I created a class to retrieve comments from a JSON encoding from a PHP file. This class, extends from AsyncTask: As you can see, I’m trying to show a ProgressDialog while the “doInBackground” proccess is working. But progressDialog constructor, asks for a Context, and I don’t know how to provide it. I’m calling this class from a Fragment, so I
Android Format date with time zone
I need to format the date into a specific string. I used SimpleDateFormat class to format the date using the pattern “yyyy-MM-dd’T’HH:mm:ssZ” it returns current date as “2013-01-04T15:51:45+0530” but I need as “2013-01-04T15:51:45+05:30”. Below is the coding used, Output: formatted string: 2013-01-04T15:51:45+0530 I need the format as 2013-01-04T15:51:45+05:30 just adding the colon in between gmt time. Because I’m working on