Technical answers from my Stack Overflow history, with source links and licenses.
- reputation
- 0
- people reached
- ~0.0m
- badges
- 21137149
- answers
- 0
Stack Overflow badges
Showing 28 of 268 answers
Exported May 9, 2026
- 0score115viewsyesstatus
- 0score64.7KviewsnostatusCC BY-SA 3.0
How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder?
Here is a similar answer to Matthew Willis but with added reflection. Why? because science.
- 0score2KviewsnostatusCC BY-SA 3.0
OnTouchListener intercept when touch goes outside view
Here is a View.OnTouchListener that you can use to see if MotionEvent.ACTION_UP was sent while the user had his/her finger outside of the view:
- 0score413viewsnostatusCC BY-SA 3.0
How to serialized object of ViewGroup in Android?
ViewGroup extends View which does not implement Serializable . So, this is impossible.
- 0score602viewsnostatusCC BY-SA 3.0
Make Simple Accordion Scrollable
Since you have a ListView in the same layout, you should avoid adding a ScrollView as others have suggested. I would put the attributes in styles for each "panel" to remove redundant code. I would then add your layout...
- 0score679viewsnostatusCC BY-SA 3.0
Android: How can I set value of SeekBar
How can I call this following method in above java file? In onCreateView(LayoutInflater, ViewGroup, Bundle) you can still use findViewById(int) . The following will call the constructor you want:
- 0score1.6KviewsnostatusCC BY-SA 3.0
Android Failed to find style in current theme
I am assuming you copied your code from this StackOverflow answer . numberPickerStyle would be an attribute that is defined in your app. The code that you copied from the answer does not work. You would need to define...
- 0score1.4KviewsnostatusCC BY-SA 3.0
Regex for splitting string into arraylist in java
It looks like an easy solution if this is the only String you are attempting to split. Something like this would work for the input String you provided in your question: You can use http://regexpal.com/ to help you in...
- 0score898viewsnostatusCC BY-SA 3.0
get the context from an non-activity class into a non-activity
You should pass the context to the constructor or method you are calling. Edit: Just for fun, you can actually get the application context in a static way. This is not recommended:
- 0score134viewsnostatusCC BY-SA 3.0
Error due to action bar activity
The appcompat themes remove the native ActionBar and use the support ActionBar. You need to change To You also need to change Base.Theme.AppCompat.Light to Theme.AppCompat.Light in your AndroidManifest. Please see this...
- 0score402viewsyesstatusCC BY-SA 3.0
google play referrer and localy installed app referrer
You will not be able to use the pm command with your application UID; you need to be root (0) or shell (2000). This may be why you are getting a permission denied error. I successfully set the installer package name...
- 0score465viewsyesstatus
- 0score538viewsyesstatusCC BY-SA 3.0
How to Display First letter of Word capital in to the name android
As mentioned in the comments, there are many answers to this question. Just for fun I wrote my own method real quick. Feel free to use it and/or improve it: Test: Output:
- 0score4.2KviewsnostatusCC BY-SA 3.0
Linked List Constructor with initial value
Does your class extend LinkedList ? If so, here is what I would do: It isn't a great idea to extend LinkedList. If you want an easy way to create a new LinkedList with elements use the following method:
- 0score218viewsnostatusCC BY-SA 3.0
Calculate button is not working in android
The problem: One (or all) of your EditText s is not a valid integer and is failing on Integer.parseInt(String) . You should handle any NumberFormatException and check the value of your EditText s (feet, inches, lbs)....
- 0score2.6KviewsnostatusCC BY-SA 3.0
How to start adb server over tcp programmatically
You need root access to do this. It would be a huge security issue otherwise. You can use a library like libsuperuser to run root commands. Example using libsuperuser:
- 0score134viewsnostatusCC BY-SA 3.0
Android list setSelection() is not pointing to the correct item
If you post some code it would be helpful. However, having had issues with this in the past I know using postDelayed usually fixes it:
- 0score815viewsyesstatusCC BY-SA 3.0
Importing com.android.dx
Open up android.jar and navigate to com.android. You will notice the package com.android.dx is omitted. Edit: You should be able to add dx.jar as a dependency. It should be located in...
- 0score753viewsnostatusCC BY-SA 3.0
Deserialize JSON object to String Android
For something that simple I don't think adding Gson as a dependency is worth it. Example:
- 0score2.6Kviewsnostatus
- 0score791viewsnostatusCC BY-SA 3.0
Save Arraylist of custom objects SharedPreferences
I would look into storing the data into a SQLiteDatabase . SharedPreferences wasn't intended to save custom objects. If you really want to use SharedPreferences then Gson will be the best solution. API 11 added the...
- 0score137viewsnostatusCC BY-SA 3.0
Link directly to google play app
Please see Linking to Your Products . Most likely, you are using the website URL. Try the following intent below: You should also check if com.android.vending is installed before starting that intent.
- 0score10.3KviewsnostatusCC BY-SA 3.0
How to use my own custom EditText layout as a searchView
I wrote this class to help with SearchView customization: https://gist.github.com/jaredrummler/c408c9d897fd92d5d116 You could do something like this after inflating the menu in onCreateOptionsMenu :
- 0score57viewsnostatusCC BY-SA 3.0
Open files from own file explorer
Something like this should work. Change file to whatever you want.
- 0score674viewsnostatus
- 0score1.5KviewsnostatusCC BY-SA 3.0
Android (detect external sd card) isExternalStorageRemovable is possible with AS3 Adobe Air?
This should work: isExternalStorageRemovable() isExternalStorageEmulated()
- 0score759viewsnostatusCC BY-SA 3.0
Best way to know sd card Path Android
This is always the best approach: You could also get the environmental variable which is on all Android devices like this:
- -2score809viewsnostatusCC BY-SA 3.0
Accessing Static Final Fields in Inner Classes in Java
I think the reason why new Test().new C().i works is because class Test is a top-level class and is treated as static . If you were to change your inner class C to be static then new C().i would work. However, you...