mapactivity

Map activity in android

萝らか妹 提交于 2019-12-06 04:10:14
I have created map actvity.But its not showing map on mapview.just showing blank blocks. is there any solution? activity_main.xml- <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.MapFragment"/> activity code- package com.example.googlemap; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) {

MapFragment causing NullPointerException at getMapAsync(this) method

一世执手 提交于 2019-12-05 02:50:09
I have implemented an activity which adds MapFragment at run time. The MapFragment xml has static fragment and I'm trying to get add at run time. Also I found there are some issues in Lollipop adding the map fragment at runtime. Kindly check Issue raised and temporary solution I have also given my codes below, fragment_map.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".fragment.MapsFragment"> <fragment android:id="@+id/map" android

Does the first MapActivity instance always leak?

删除回忆录丶 提交于 2019-12-05 01:40:43
问题 While investigating memory issues in our application, it turns out that if the application Activity is a MapActivity, the first instance of it won't be finalized. Leading to other memory leak such as the view passed to setContentView. Does anyone notice that before? Here is the testing code showing that "MainActivity : 1" is not finalized whereas it is if MainActivity inherits from Activity. To test, one needs to change device or emulator orientation many times. import com.google.android.maps

MapActivity in TabHost Fragment disappearing after tab switch

半腔热情 提交于 2019-12-04 14:13:00
问题 I'm trying to display a map in a set of tabs, using fragments. The problem I'm having is the map activity disappears if the user navigates to another fragment, then back. How can I display a MapActivity in fragments in a tabhost? The basis for this is from the numerous questions around how to integrate a MapActivity with fragments (see MapView in a Fragment (Honeycomb)) MainTabActivity has a tabhost and uses FragmentManager to display Fragments in the tabs. MapFragment has a tabhost and uses

Does the first MapActivity instance always leak?

≡放荡痞女 提交于 2019-12-03 16:22:06
While investigating memory issues in our application, it turns out that if the application Activity is a MapActivity, the first instance of it won't be finalized. Leading to other memory leak such as the view passed to setContentView. Does anyone notice that before? Here is the testing code showing that "MainActivity : 1" is not finalized whereas it is if MainActivity inherits from Activity. To test, one needs to change device or emulator orientation many times. import com.google.android.maps.MapActivity; import android.app.Activity; import android.os.Bundle; import android.util.Log; public

MapActivity in TabHost Fragment disappearing after tab switch

徘徊边缘 提交于 2019-12-03 08:03:55
I'm trying to display a map in a set of tabs, using fragments. The problem I'm having is the map activity disappears if the user navigates to another fragment, then back. How can I display a MapActivity in fragments in a tabhost? The basis for this is from the numerous questions around how to integrate a MapActivity with fragments (see MapView in a Fragment (Honeycomb) ) MainTabActivity has a tabhost and uses FragmentManager to display Fragments in the tabs. MapFragment has a tabhost and uses it to display a MapActivity. MapFragment does use LocalActivityManager to propogate lifecycle events

Manifest Merger Failed against application component factory

天涯浪子 提交于 2019-12-02 18:44:15
问题 I am a beginner and using MapActivity for the first time, my project is generating some errors titled "manifest merger failed" and suggesting to add a line in the android manifest file Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app

Android Google Mapview Activity not opening in Android Studio

↘锁芯ラ 提交于 2019-12-01 23:35:19
问题 I am new to Android and am trying to display a Google Map on an Android Phone. I created the API Key that should work for any Android App ( I did not give any specific SHA for my app). I am guessing that should not matter. Using the Google Android Tutorials, I am doing all the steps, I get the google watermark on the left bottom, but no map. I will post all the code being used. I have tried to use the Google Maps Activity shipped in Android Studio 1.2.1.1. I don't get any errors, but don't

Multiple activity on screen of Android?

£可爱£侵袭症+ 提交于 2019-12-01 22:32:20
So the problem is I need to create a screen where I have a map and a list under it , but to have a map I have a : public class MyMapActivity extends MapActivity{} to have a list i have : class MyListActivity extends ListActivity{} since there is no multiple inheritance ,what is the correct way to do this? Does Android have any Interface for this ? How would you do this? So i did it like this: MapView mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); ListView lv = (ListView)findViewById(R.id.mylist); lv.setTextFilterEnabled(true); lv.setAdapter((new

Android Google Mapview Activity not opening in Android Studio

落爺英雄遲暮 提交于 2019-12-01 21:06:55
I am new to Android and am trying to display a Google Map on an Android Phone. I created the API Key that should work for any Android App ( I did not give any specific SHA for my app). I am guessing that should not matter. Using the Google Android Tutorials, I am doing all the steps, I get the google watermark on the left bottom, but no map. I will post all the code being used. I have tried to use the Google Maps Activity shipped in Android Studio 1.2.1.1. I don't get any errors, but don't get the map either. I am using a MapFragment as it seems to be easier than the MapView. I also viewed the