android,android-maps,android-fragmentactivity,android-maps-v2,supportmapfragmentRelated issues-Collection of common programming errors


  • Jane Wayne
    android python monkeyrunner
    i have the following python script in an attempt to take a screen shot of a device (not an emulator).import sys import timefrom com.android.monkeyrunner import MonkeyRunner, MonkeyDeviceCONNECTION_TIME_OUT = 30 deviceName = str(sys.argv[1]) pathName = str(sys.argv[2])device = MonkeyRunner.waitForConnection(CONNECTION_TIME_OUT, deviceName) result = device.takeSnapshot() result.writeToFile(pathName,’png’)i run this script at the windows command prompt as follows.monkeyrunner.bat -v ALL %SCRIPT_DIR

  • Cy Kaustav
    android phonegap extjs gcm
    Hi i have already built the native GCM application for Android which is working very fine in all my android devices. But i want to further use this GCM service like i want to integrate this GCM service with my existing Android app as for for testing i have already done my server for GCM but i am lagging behind all because of the Client side implementation. i have been trying to get the relevant information regarding my project but i couldn’t be able to find an resource of Client Side Implementat

  • genpfault
    android animation video text opengl-es
    We are trying to create a text animation like Transition and Zoom on the Video. We are not able to get Smooth transition and the effect is so jerky. Then we understood sub pixel rendering is not possible in android. What alternatives can we think of? Can we solve this problem in OpenGL?Ok… I would like to add more to my question….We are actually trying to implement text animations on top of a video which is played by a native player on a surface view. We tried to achieve the text animation

  • tazeenmulani
    java android sqlite
    I work with SQLite database in my Android application.I want only one column retrieved in spinner.When i run the application ,the application is crash.And my log cat shows “Bad request for field slot 0,1. numRows = 1, numColumns = 1”.Below are the codes for retrieving data from database and put it into spinner(NewleadActivity.class).This is my Adapter classpublic class DbHelper extends SQLiteOpenHelper{// Database Version@SuppressWarnings(“unused”)private static final int DATABASE_VERSION = 1;//

  • Santhosh
    java android inputstream ioexception processbuilder
    making a class , with several functions , I am having a problem with one of these functions which will use the ProcessBuilder to send a command and take its output as a string , acting as a shell command . When I use it , it catches an IOException , with a Bad file number , at the InputStreamReader , and returns “ERROR!!!” , here is my code , if you need to know anything about this comment … I am using the command “ls” btw , “ls /sdcard/” …public String builder(String str) { startTimer();

  • Kara
    android out-of-memory
    I am developing an Android Application to load some images to emulator, but it fails with the below error:11-07 19:38:51.596: E/dalvikvm-heap(322): 73670400-byte external allocation too large for this process.11-07 19:38:51.596: E/GraphicsJNI(322): VM won’t let us allocate 73670400 bytes11-07 19:38:51.596: D/AndroidRuntime(322): Shutting down VM11-07 19:38:51.616: W/dalvikvm(322): threadid=1: thread exiting with uncaught exception (group=0x4001d800)11-07 19:38:51.926: E/AndroidRuntime(322): FATA

  • Patrick Mahoney
    android toast android-xml
    I know that I could do all of this easily with a custom toast layout, but in creating a custom layout, I would no longer be using the system’s default toast view.Example: Toasts of course look different in Android 2.2 vs Android 4.0. If I create a custom view for my toast, then it will look the exact same in both versions, but what I want is for it to retain its… “Androidiness” for lack of a better word. Basically, does anyone know of a default toast XML layout? Is that even possible?

  • Vyger
    android sqlite contacts contactscontract
    Hi I am trying to get data from Contacts Table through contentprovider but it Crashes every time when I started my app,Here is my source code:public class WebpreneurActivity extends ListActivity {private DBHandler dbHelper;private Cursor phones;ImageButton imageButton;public static long rowId;@Overrideprotected void onCreate(Bundle savedInstanceState) {Log.d(“database1″ ,”0”);Log.d(“Your Location4”, “ok4:”);super.onCreate(savedInstanceState);Log.d(“database1″ ,”1”);setContentView(R.layout.acti

  • user2586942
    android
    I have this login acitivity that fetches the values from a server.i am able to retreive the values correctly but i am getting an illegal state exception.—————————————————————————————————————————————————————————————————————– code:public class StartActivity extends Activity {String[] classname= new String[10]; String[] pass= new String[10]; EditText class_name,

  • MattDavis
    android android-camera
    I tried to implement front facing camera in my application. I used the following code. It works fine with the back camera. But I cant change the camera to front camera.package com.fsp.googleimagesearch;import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date;import android.app.Activity; import android.content.Context; import android.content.Intent; import android.database.Curso

  • JanBo
    android android-manifest android-maps android-maps-v2
    I am using Android Google maps V2 in my application. If the user doesnt have internet connection, i send them to an alternative activity without maps.The problem is that my app is not supported on devices that dont have openGL2, because of manifest:<uses-feature android:glEsVersion=”0x00020000″ android:required=”true”/>If i put required element to false, the maps dont show.Is there a way to program this somehow during run-time? Or any other alternatives?

  • animuson
    android android-maps
    I want to to change the google map view from one state to another. Currently the view is satellite view, now I want to change it to street view. I have written as below but it’s not changing the view. How do I change the view at run-time?mapView.setStreetView(true);

  • AndreaF
    android android-mapview android-maps geopoints
    This in a bit complex issue so read carefully.I have tried to realize a map that -shows my current position, -when I click on a point in the map, the app should place a custom geoPoint getting latitude and longitude to pass these to an activity to create a new Pub object-the map on start must show the positions of Pubs saved beforeFollowing this tutorial I have created these classClass MyMap:public class MyMap extends MapActivity implements LocationListener {private MapView mapView;private Locat

  • Adrian Olar
    android android-maps android-support-library
    I am using SupportMapFrgment to ensure backwards compatibility for the Google Maps API in my application.It seems to load the map just fine on 4.1 but i get a crash on 2.3.4.Here’s my code:private String getCurrentLocation() {LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);Criteria criteria = new Criteria();String provider = service.getBestProvider(criteria, false);Location location = service.getLastKnownLocation(provider);LatLng userLocation = new LatLng(location.

  • gkris
    android gps android-maps
    I am trying to develop an application which has a button, which on clicking should lead me to my current location in the map. My main confusion is the OnClick Listener and the Map events. Where can i possibly go wrong?Here is my code:-package geopoint.ns;import java.io.IOException; import java.util.List; import java.util.Locale;import android.content.Context; import android.graphics.Canvas; import android.graphics.Point; import android.location.Address; import android.location.Geocoder; import a

  • Antrromet
    android google-maps android-emulator android-maps
    I am using the following map class to use maps in my android app…package com.wglxy.example.dash1;import java.io.IOException; import java.util.List;import android.app.AlertDialog; import android.content.Intent; import android.location.Address; import android.location.Geocoder; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import

  • user1918034
    android android-intent android-maps android-location android-cursor
    Hi below is my code for checking gps settings which works perfectly on all devices with android 2.3.6 and lower , but not in ICS and Jellybean. When i check for GPS settings enabled or not on the device and start the location settings intent and enable the GPS and return to my app , when i check again for GPS it still shows disabled and force closes the apppublic GPSTracker(Context context) {this.mContext = context;getLocation();}public Location getLocation() {try {locationManager = (LocationMan

  • aseem
    android android-maps android-fragmentactivity android-maps-v2 supportmapfragment
    Earlier i have made an application in which i have used Maps with Fragment. In XML layout file i have used “fragment” element (using SupportMapFragment) and used in my activity by using setContentView and have defined some marker. It works fine.Now this time i tried to make another activity and its corresponding XML layout in same application…I have just inflated XML layout…it gives error of force close.I have searched many time on internet but not get helped clearly. Please show me the way.

  • slyder07
    android android-fragments android-mapview android-maps android-fragmentactivity
    I have an activity, what I’m trying to do is to start a new activity that holds a Google Maps Fragment API v2 following this example (https://developers.google.com/maps/documentation/android/start). I get an runtime error “Binary XML file line #4: Error inflating class fragment” This the XML of activity:<?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”android:layout_width=”match_parent”android:layout_height=”match_parent”andr

  • Sanchit
    android google-maps android-maps
    I started on with a car finder activity in my car manager application. I planned to show up a simple google map as a first step. I wrote up the following codes. carfinder.xml<?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <com.google.android.maps.MapView android:id=”@+id/mapView” android:layout_width=”fill_parent”

  • Tyler Pfaff
    android android-fragments android-fragmentactivity
    In the method below, NasaDailyFragment is always null in the debugger. The method call NasaDailyFragment.onRefresh(); fails using because of this. I can’t figure out why its null. public class NasaAppActivity extends FragmentActivity { //other methodspublic void onRefreshClicked(View view){Log.d(“debug”, “in run”);FragmentManager fragmentManager=getSupportFragmentManager();NasaDailyImage NasaDailyFragment=(NasaDailyImage)fragmentManager.findFragmentById(R.id.fragment_iotd);if(NasaDailyFragment!

  • Matthieu
    android intellij-idea robotium android-fragmentactivity android-testing
    I’ve tried everything I could think of, but still I cannot run my tests using Robotium.I set the robotium library and my main project to be exported in the Project configuration as suggested hereI’ve set the android:debuggable flag to true as suggested hereI also checked the android:targetPackage is set properly in the manifest as suggested hereAlso tried to change the scope of the main project dependency when building the test module to Provided instead of Compile (I am not sure what that does.

  • Kamalone
    android actionbarsherlock android-fragmentactivity
    This question already has an answer here:After Google Play Service update to version 13 I got an error4 answersWhat happened is i changed my project from one machine to another. When i am running my app from the first machine it is running successfully but the same application gives a forceclose while starting the app. My project is using two libraries 1. ActionBarSherlock library 2. GooglePlayService LibraryThe error log i am getting is given below.Failed to inflate android.view.InflateExceptio

  • Erum Hannan
    java android android-fragmentactivity android-loadermanager
    I am newbie in android and have used this code while when i am trying to open this Activity its giving me error.CODE:public class LoginActivityService extends Activity implements LoaderManager.LoaderCallbacks<List<User>> { Context context;EditText userName,password,version;Button logoutBtn;LoginLoader loginLoader;ImageButton loginBtn;@Overridepublic void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.login_view_service);context = this;

  • Rijvi Rajib
    android android-fragments android-fragmentactivity
    I’ve used the basic layout created from the Eclipse “Master/Detail” layout. I’ve modified it out and added external pages. However, when I now try to load just ContactListActivity.java, it fails to load giving me the logcat error below. Any ideas on what I’m doing wrong?ContactListActivity.javapackage com.cyphrd.chirpd;import com.cyphrd.chirpd.R;import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; import android.view.M

  • EGHDK
    java android android-fragments android-fragmentactivity
    I run a setText command inside of a fragment activity to try and set the text of a textView in the parent activity, but it’s not working. Any ideas?TextView text = (TextView) getView().findViewById(R.id.status);text.setText(“Text from a fragment”);I don’t get an error in eclipse, but I get a null pointer exception during runtime. Of course it happens at the line where I setText. Any ideas on how to do this?

  • vish
    android listview android-listfragment android-fragmentactivity android-lazyloading
    I am trying to implement lazy load on a listview in a tab fragment to load the elements of an array abc. I am trying to load 10 elements, then when the user scrolls down, next 10 elements will be loaded. But My app is not working as I am not able to jump to the UI thread in order to update it(runonUithread(returnRes); not working). COuld you [please take a look at the below code and suggest the right way to implement lazy load. Thank you.Fragment Class:package com.example.abe;import java.util.Ar

  • user2924853
    android android-layout android-fragmentactivity
    I am making an android application containing more than 200 buttons………… Each button respond to an activity………..Each activity contains a button, text view and and image………… Is there any short way so that i could get rid of these many activities and have a single activity with a button and an image.And when i will click a button then it displays me the respective image with a button in that single activity. My main activity containing two buttons named Urdu and English…….

  • Vicent
    android android-dialogfragment android-fragmentactivity
    I’m learning to use Fragment and DialogFragment. As a training I’m trying to extend the AlertDialog example given in the DialogFragment page. Apparently everything is fine: when I show the options menu and click its button a dialog appears and it behaves as expected. However if the configuration changes (for instance when I rotate the screen) while the dialog is displayed then the dialog is recreated properly but clicking any of its buttons crashes the application. I’ve tried lots of things (for

  • Kumar Kalluri
    android android-fragmentactivity
    I used the two tab widgets in one fragment activity. I took fragments for each tab for both sides.If i click on tab on first tab widget,corresponding number on tab of second widget also works.For that,I have used add,remove, replace methods. But app runs some time ,It crashes due to out of memory exception.The whole process is going on only fragmentActivity.** When I replacing the fragment, It recreating the fragment even it is loaded previously.Searched on some sites,It confuses me how to dea

  • m3n0R
    android intellij-idea android-maps-v2
    I’m trying to switch from Eclipse to IntelliJ IDEA for Android developing.Currently I have an Android application which depends on more than 10 libraries (including third libraries and jars).First of all, when I tried to run the application, I got a Dalvik DEX error. I could solve that modifying the scope of the dependencies of my projects, not mine. After I did this, I got this other error, which I don’t know how to solve it…03-11 16:10:10.423: ERROR/AndroidRuntime(10258): FATAL EXCEPTION: ma

  • JanBo
    android android-manifest android-maps android-maps-v2
    I am using Android Google maps V2 in my application. If the user doesnt have internet connection, i send them to an alternative activity without maps.The problem is that my app is not supported on devices that dont have openGL2, because of manifest:<uses-feature android:glEsVersion=”0x00020000″ android:required=”true”/>If i put required element to false, the maps dont show.Is there a way to program this somehow during run-time? Or any other alternatives?

  • Bertuz
    android intellij-idea android-maps-v2
    I’m developing an Android APP and I would like to put in some maps. So, because of some well known IntellijIDEA bugs, I tried to follow some pieces of suggestions I’ve found here and there to make it work, but I’m still into trouble.So: to import the libs I needed, I followed this good piece of suggestion, also referenced here in stackoverflow. I then created my test activity and its test layout. Here they are:package org.altervista.bertuz83.sgaget;import android.support.v4.app.FragmentActivity;

  • kort.es
    android android-maps-v2 google-play-services
    I have sucessfull working android maps API v2, but then i tried to test if i dont have Google Play services, will app offer to install it. So i uninstalled Google Play services and my application is crashing now. Its not offering to intall Google Play services like it does in Sample App. In LogCat its printing Google play services is missing and after NullPointerException. In sample app i didnt see any code that handles that, i guess its inculded in map library. Im using SupportMapFragment, howe

  • user1842744
    android google-maps android-maps-v2
    I tried below code for a debug key and its working fine. When i make a apk then map is crashing. After searching in google i found debug key is work in release mode.keytool -list -v -keystore “C:\Users\your_user_name\.android\debug.keystore” -alias androiddebugkey -storepass android -keypass androidSo,how can i create a release key for v2 maps. please help me.

  • Santhucool
    android android-maps-v2
    I have used this code for finding current positiongoogleMap.setMyLocationEnabled(true);LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);Criteria criteria = new Criteria();String provider = locationManager.getBestProvider(criteria, true);Location myLocation = locationManager.getLastKnownLocation(provider);googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);double latitude = myLocation.getLatitude();double longitude = myLocation.getLongitude();LatLng latlng = new

  • Ram kiran
    android android-maps-v2
    I tried to make a sample project using Google Map, but I couldn’t. Help me please!Test Device : Android 4.0.4Error Message : 12-29 23:45:32.605: E/AndroidRuntime(9437): FATAL EXCEPTION: main 12-29 23:45:32.605: E/AndroidRuntime(9437): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test_googlemap/com.example.test_googlemap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment 12-29 23:45:32.605: E/AndroidRuntime(9437

  • Asim Munawar
    galaxy android-maps-v2
    I have a very simple application that uses google maps api v2. It is just a map with around 100 markers. The application runs great on different android devices including.HTC Desire HD (2.3.x) Sharp Galapagos (2.3.x) ASUS TF300T Tablet (4.1.x)But on Samsung S3 (4.0.4), I keep getting “Out of memory” error like08-18 18:38:42.446: E/dalvikvm-heap(9160): Out of memory on a 1378292-byte allocation.The error occurs randomly, sometimes after a few seconds sometimes after a minute and sometimes when I

  • Bilel
    android map android-maps-v2
    I’m trying to get the sample code of Android ‘Google Maps Android API v2’ working. I get the project built without errors. However, when I try to run the app on Everpad , the app crashes immediately.The logcat output:08-30 17:12:42.620: E/dalvikvm(4352): Could not find class ‘com.dvp.android.gallery.GPS’, referenced from method com.dvp.android.gallery.Acceuil$5.onClick 08-30 17:12:47.670: E/InputDispatcher(3263): Motion event has invalid action code 0xa 08-30 17:12:47.760: E/InputDispatcher(3263

  • Tony Tong
    android google-maps android-emulator android-maps-v2
    i followed the http://ddewaele.github.io/GoogleMapsV2WithActionBarSherlock/part1 to use actionsherlock on SupportMapFragment. But it crashes every time I tried to runs it on API 10 emulator. On ICS emulator it runs fine, of course the map won’t display on emulator but at least it won’t crash. So I wonder if SupportMapFragment is supposed to CRASH on “low end” emulator? Since I flashed my 2.3.6 phone to 4.2.2, therefore I can’t test the apk on physical API 10 device. Thank you!

  • DanielVasic
    android google-maps-android-api-2 supportmapfragment
    I have a problem with running SupportMapFragment on Android (API 10) here is what I get from logcat:02-22 02:16:09.516 1132-1202/? E/ActivityManager? heap conf. property name string trimmed: hs.com.lge.android.calendar.wid 02-22 03:50:54.214 15767-15767/? E/ActivityThread? Service com.koushikdutta.rommanager.DownloadService has leaked IntentReceiver com.clockworkmod.billing.ClockworkModBillingClient$8@4054cb08 that was originally registered here. Are you missing a call to unregisterReceiver

  • Neil
    monodroid mvvmcross supportmapfragment
    The following code works fine in a single orientation but as soon as the orientation changes it causes an exception:using Android.App; using Android.Content.PM; using Android.Gms.Maps; using Android.Gms.Maps.Model; using Android.OS; using Android.Support.V4.App; using Cirrious.MvvmCross.Droid.Fragging; using System; using System.Collections.Generic; using System.Drawing;namespace Demo.Droid.Views {[Activity(Label = “View for MapViewModel”, Theme = “@android:style/Theme.NoTitleBar”, Configuration

  • hoss
    android google-api android-studio supportmapfragment mapfragment
    I have searched many hours and days to find the answer to this, but still cannot. I am using Android Studio (latest ver) IDEI am trying to create a map view (using Google Maps API) into a Fragment that is part of a FragmentActivity.AndroidManifest was updated with necessary permissions and Google Key.As you can see at the output, LatLng class from Google Map API is working well as I am creating an instance. Lib was imported on libs folder Please help !!EDIT: Found this instructions How to build

  • Michael
    google-maps-android-api-2 supportmapfragment mapfragment
    I am working with the Google maps API V2 and it is going fine. i have a 2.2.2 android device wich i use to debug my app.now i just got a Galaxy Note 2, and when i try to debug on that device the app imidiatly crashed “project has stopped working”.So i just made a small example to test with. and again it runs great on 2.2.2 but not on 4.1.1.this is the code i have for the small example exerciseAny suggestions would be much appreciatedMy Layout<RelativeLayout xmlns:android=”http://schemas.andro

  • aseem
    android android-maps android-fragmentactivity android-maps-v2 supportmapfragment
    Earlier i have made an application in which i have used Maps with Fragment. In XML layout file i have used “fragment” element (using SupportMapFragment) and used in my activity by using setContentView and have defined some marker. It works fine.Now this time i tried to make another activity and its corresponding XML layout in same application…I have just inflated XML layout…it gives error of force close.I have searched many time on internet but not get helped clearly. Please show me the way.

  • NirPes
    android google-maps android-fragments google-maps-android-api-2 supportmapfragment
    I managed to make it work, but when I switch the fragments the app crashes.another thing that I want, Is to make the fragment show exactly in the state the user left it.What I mean is that I don’t want to make a new instance of the fragment every single time the user clicks the button that switches to it.the FragmentActivity:import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.

  • Harsha M V
    android android-fragments google-play-services supportmapfragment
    public class PlaceMapsFragment extends SupportMapFragment {private GoogleMap mMap;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {super.onCreate(savedInstanceState);View v = inflater.inflate(R.layout.fragment_place_maps, container,false);setUpMapIfNeeded();return v;}private void setUpMapIfNeeded() {if (mMap == null) {mMap = ((MapView) findViewById(R.id.map)).getMap();if (mMap != null) {setUpMap();}}}private void setUpMap() {mMap.addMarke

  • lyk
    android android-maps-v2 supportmapfragment
    I’m trying to implement Google Map display and below are my codes:package com.fragments;import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup;import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment;public class MapFragment extends SherlockMapFragment {private GoogleMap mMap;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {View root

  • Harsha M V
    android android-fragments android-maps supportmapfragment
    I have a Fragment which Extends SupportMapFragment.public class PlaceMapsFragment extends SupportMapFragment {private GoogleMap mMap;private LatLng mPosFija;public PlaceMapsFragment() {super();}public static PlaceMapsFragment newInstance(LatLng posicion) {PlaceMapsFragment frag = new PlaceMapsFragment();frag.mPosFija = posicion;return frag;}@Overridepublic GoogleMap getMap() {// TODO Auto-generated method stubreturn super.getMap();}@Overridepublic void onCreate(Bundle arg0) {// TODO Auto-generat

  • Harsha M V
    android android-support-library google-play-services mapfragment supportmapfragment
    I am trying to use the new Google Play Services Lib and embbed Maps in side the Maps Fragment as belowPlaceMapsFragment.javapublic class PlaceMapsFragment extends SupportMapFragment {private GoogleMap mMap;private LatLng mPosFija;public PlaceMapsFragment() {super();}public static PlaceMapsFragment newInstance(LatLng posicion) {PlaceMapsFragment frag = new PlaceMapsFragment();frag.mPosFija = posicion;return frag;}@Overridepublic GoogleMap getMap() {// TODO Auto-generated method stubreturn super.g

Web site is in building