java.lang.SecurityException when starting the location service

I tried to run location service as background service. It works fine in activity, but when I used service, I got java.lang.securityException: Client must have ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to perform any location operation

Libgdx text in the rotation of places

In libgdx is there any way to rotate a text around itself? Actually i need to keep the text always aligned horizontally without any rotation while the SpriteBatch of the text and the background can be translated/rotated by user's gesture. (I am using

Error setting custom ListView image

I want to set a custom ListView with ArrayAdapter. Every ListItem has an ImageView and two TextViews. The layout of each Item rowlayout.xml: <RelativeLayout xmlns:android="" android:layout_width="

Loading multiple images with Picasso in the background

I am trying to get loaded an array of 20 urls in background with Picasso. So far i have the next code: Log.d("GAME", "Loading all images"); for (int i = gamePieces.length-1; i >= 0; i--) { GamePiece p = gamePieces[i]; Log.d("GA

Android Listview Async Loading image

I have listview at which I am trying to implement an async task that loads the image into the view inside the getView method of my adapter. I have succeeded in creating this however my problem is that since in the listview and the adapter the view ge

How to use the default back button in the Android app

I am new to android... I have created an android application in which in my Main Activity i added No. of buttons in that class.. Also when user click on particular button it shows other class(I have created draw-method inside view class) When I click

Rotation of the relative layout

I am getting the blank space at the bottom when I try to rotate the relative layout... Here is my xml layout <RelativeLayout xmlns:android="" android:layout_width="match_parent" android:layo

Activity not found when you try to start from AlertDialog

Been trying to get my app to go back to the main activity when a user touches the OK button inside an AlertDialog. The alert dialog I show is basically an error message to inform the user that no data was found for a specific date they chose and call

Return declaration with try / catch

I know that for many of you this can be a stupid question, but I'm learning android/java and I still have some concepts unclear. In this case, I'm not sure on what is the best way to use the return statement within a try/catch block. This is how I ha

How to navigate in different tables and objects in a JSON file

I am trying to get data from this JSON file like this: If you have a look at the file by a JSON editor(like this), you will see that there are arrays and objects inside arrays. I can Only get access t

Android erase the data when the app goes in the background

I have an app(many activities). I want to clear few values like user credentials when the app goes background. How can I know when the app goes background? I tried to intercept the home button but seems like we cant do tht.If I call onPause(), it get

Receiving the EXTRA_MESSAGE intent from another application

In my Eclipse workspace I have my main application: A and I have another fully functional application: B I have configured appliction A to open up application B upon the click of a button by using an Intent and it works. Here is the issue: In applica

Maven Android Plugin and Library Projects

I have created an android application using maven-android-plugin, I want to use Android-ViewPagerIndicator and I've added dependency in the pom.xml. <dependency> <groupId>com.viewpagerindicator</groupId> <artifactId>library</art

The application stopped unexpectedly, please try again.

On clicking of textview of Loginform i was redering the page towards my Registration form. It was working fine before writting code in registration form. But suddenly (After writting code in Registration form) , it started giving me above error after

How to get Android camera preview data?

My camera app displays a camera preview on the screen and also processes it in the background. Here is the relevant code, condensed as much as possible (e.g. no error handling or field declarations shown): public final class CameraView extends Surfac

Eclipse [NO-HEAD Office]

Beside my project name says [Desktop NO-HEAD] in eclipse. I am developing an android application, and was wondering if there is anything wrong with this, why it might be saying that, and if it makes a difference to anything, though everything seems t

Does animateLayoutChanges work on ListView?

a listView is a ViewGroup and seems like a good candidate for having animated layout changes. However, it seems to disregard the flag or constructing a LayoutTransition manually and setting it up that way. What gives? It's not documented anywhere tha

Emulator for galaxy s3

Has Samsumg provided emulator support for galaxy s3. I want to test my app on S3 Emulator as I'm reading the comments on google play that the app is crashing on Samsung Galaxy S3. Can someone help me with this. Thanks in can use the samsu

Android onKeyDown () does not run by pressing the back button

Hi after searching on google i come here to ask about help. I use following method to go back when user press back button of device. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { Log.i("===B

The Eclipse upgrade does not work

My Eclipse out of the blue stopped building my Android so I removed the old version and have installed Indigo. When I try to import an Android project in I get this error: Errors occurred during the build. Errors running builder 'Android Resource Man

Is it possible to do a horizontal NumberPicker?

The widget NumberPicker from Android is vertical, with the increase and decrease buttons above and below the number display. Is it possible to make it horizontal? With the buttons on the left and the right of the number?You cannot change NumberPicker

Android version of the API release

Is there any way to get the API version that the phone is currently running?As described in the Android documentation, the SDK level (integer) the phone is running is available in: android.os.Build.VERSION.SDK_INT The class corresponding to this int