Skip to content
Advertisement

Tag: android

How to set delay in android?

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:

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

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

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

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

Advertisement