10 Replies - 2792 Views - Last Post: 28 January 2015 - 01:25 PM

#1 dermot31   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 27-January 15

Android application xml confusion, help !

Posted 27 January 2015 - 12:55 PM

Hello. Sorry, I couldnt find an android section
I am currently undertaking a project in android development for the first time. I have a couple of years experience with java, but the android apis are all new to me. Anyway, the java is not my difficulty. I am using eclipse and my project is map based. Im using google maps api v2. I have set up project to execute targeted at api 21 with 19 the min. I am testing on a device running kitkat 4.4. I have all the apis and support libraries installed.

My problem is with the xml in activity_main.xml
I am new to xml, but I understand this file has to be manipulated to add extra features to the app.
My problem is that everytime I try to add the needed xml to the file, the app fails to start after.Nothing works unless my activity_main.xml file contains only the following:

Any advice or pointers from a knowledgeable person would be greatly appreciated, as I say I am a noob to android, and this issue is really holding me back

<?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"/>





I am trying to experiment with maps and street view and my xml is showing no errors:

<?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"
          >
    <fragment 
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          class="com.google.android.gms.maps.SupportMapFragment" />
    
    <fragment
    android:name="com.google.android.gms.maps.StreetViewPanoramaFragment"
    android:id="@+id/streetviewpanorama"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
    
    </LinearLayout>






My main activity is this at present, it is quite bulky as I am just playing around at the moment:

package com.example.mapstutorial;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMapLongClickListener;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnStreetViewPanoramaReadyCallback;
import com.google.android.gms.maps.StreetViewPanorama;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import android.location.*;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
//import android.location.Criteria;
//import android.location.Location;
//import android.location.LocationListener;
//import android.location.LocationManager;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import android.app.Dialog;

public class MainActivity extends FragmentActivity implements LocationListener,OnStreetViewPanoramaReadyCallback {
	
	//googlemap var
	private GoogleMap googlemap;
	Context context = this;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//setContentView(R.layout.activity_main);
		//setUpMap();
		if(isGooglePlay())
		{
		setContentView(R.layout.activity_main);
		setUpMap();
		}
	
		addMarker();
		
		LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE);
		
		String provider = lm.getBestProvider(new Criteria(), true);
		
		//check provider
		if(provider == null)
		{
			onProviderDisabled(provider);
		}
		
		googlemap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() {
			
			@Override
			public void onMapLongClick(final LatLng latlng) {
				// TODO Auto-generated method stub
				LayoutInflater li =  LayoutInflater.from(context);
				
				final View v = li.inflate(R.layout.alertlayout, null);
				AlertDialog.Builder builder = new AlertDialog.Builder(context);
				builder.setView(v);
				builder.setCancelable(false);
				
				builder.setPositiveButton("Create", new DialogInterface.onclickListener() {
					
					@Override
					public void onclick(DialogInterface dialog, int which) {
						// TODO Auto-generated method stub
						EditText title = (EditText) v.findViewById(R.id.ettitle);
						EditText snippet = (EditText) v.findViewById(R.id.etsnippet);
						googlemap.addMarker(new MarkerOptions()
						.title(title.getText().toString())
						.snippet(snippet.getText().toString())
						
						.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE))
						.position(latlng)
		
						
								);
					}
				});
				
				builder.setNegativeButton("Cancel", new DialogInterface.onclickListener() {
					
					@Override
					public void onclick(DialogInterface dialog, int which) {
						// TODO Auto-generated method stub
						dialog.cancel();
						
					}
				});
				
				AlertDialog alert = builder.create();
				alert.show();
			}
		});
		}
	

	private void addMarker() {
		// TODO Auto-generated method stub
		LatLng  pos = new LatLng(37.7769904,-122.4169725);
		
		googlemap.addMarker(new MarkerOptions()
		.title("marker")
		.position(pos).snippet("marker")
		.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE))
		
		);
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		
		if (item.getItemId() == R.id.action_Legalnotices) {
			startActivity(new Intent(this, LegalNoticesActivity.class));
		}
		return super.onOptionsItemSelected(item);
	}
	
	//is google play services available on the device
	private boolean isGooglePlay()
	{
		int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
		
		if(status == ConnectionResult.SUCCESS){
			return true;
		}
		else{
			//links user to google play services installation
			((Dialog)GooglePlayServicesUtil.getErrorDialog(status,this,10)).show();
			//Toast.makeText(this, "Google Play Services are not installed on this Device !!", Toast.LENGTH_SHORT).show();
		}
		return false;
		
	}
	
	private void setUpMap()
	{
		if(googlemap == null)
		{
			googlemap = ((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap();
		}
		
		if(googlemap != null)
		{
			//code to initialize map
			
			//change map type
			googlemap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
			//googlemap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
			//googlemap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
			//googlemap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
			//googlemap.setMapType(GoogleMap.MAP_TYPE_NONE);
			
			//zoom controls
			googlemap.getUiSettings().setZoomControlsEnabled(true);
			
			//set to current location
			googlemap.setMyLocationEnabled(true);
			
			LocationManager lm = (LocationManager) getSystemService(LOCATION_SERVICE);
			
			String provider = lm.getBestProvider(new Criteria(), true);
			
			//check provider
			if(provider == null)
			{
				onProviderDisabled(provider);
			}
			
			Location loc = lm.getLastKnownLocation(provider);
			
			if(loc != null)
			{
				onLocationchanged(loc);
			}
			
			googlemap.setOnMapLongClickListener(onLongClickMapSettins());
				
			
			
		}
	}

	private OnMapLongClickListener onLongClickMapSettins() {
		// TODO Auto-generated method stub
		return new OnMapLongClickListener(){
		

			@Override
			public void onMapLongClick(LatLng arg0) {
				// TODO Auto-generated method stub
				Log.i(arg0.toString(),"User long clicked"); 
			}
	};
	}

	@Override
	public void onLocationchanged(Location location) {
		// TODO Auto-generated method stub
		LatLng latlng = new LatLng(location.getLatitude(),location.getLongitude());
		
		//move and zoom to current location
		googlemap.moveCamera(CameraUpdateFactory.newLatLng(latlng));
		googlemap.animateCamera(CameraUpdateFactory.zoomTo(2));
		
	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onProviderEnabled(String provider) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onProviderDisabled(String provider) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
		// TODO Auto-generated method stub
		
	}
}



Is This A Good Question/Topic? 0
  • +

Replies To: Android application xml confusion, help !

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12657
  • View blog
  • Posts: 45,831
  • Joined: 27-December 08

Re: Android application xml confusion, help !

Posted 27 January 2015 - 01:06 PM

Quote

Hello. Sorry, I couldnt find an android section

Programming Help -> Mobile Development -> Android.

I will move your thread there. :)
Was This Post Helpful? 0
  • +
  • -

#3 dermot31   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 27-January 15

Re: Android application xml confusion, help !

Posted 27 January 2015 - 01:09 PM

Thanks, must of missed that
Was This Post Helpful? 0
  • +
  • -

#4 ben255   User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 528
  • Joined: 09-September 13

Re: Android application xml confusion, help !

Posted 27 January 2015 - 02:37 PM

the manifest handles the IO to the phone and the activity is for the specific layout. read up on what xml is also other then that its not much more.
Was This Post Helpful? 0
  • +
  • -

#5 farrell2k   User is offline

  • D.I.C Lover
  • member icon

Reputation: 874
  • View blog
  • Posts: 2,706
  • Joined: 29-July 11

Re: Android application xml confusion, help !

Posted 28 January 2015 - 12:43 AM

Sure, here's some advice: If you want to display more than one object in a viewgroup, don't set both to match_parent for width and height. Other than that, you haven't given us much to the nature of your error.
Was This Post Helpful? 0
  • +
  • -

#6 dermot31   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 27-January 15

Re: Android application xml confusion, help !

Posted 28 January 2015 - 12:47 AM

View Postben255, on 27 January 2015 - 02:37 PM, said:

the manifest handles the IO to the phone and the activity is for the specific layout. read up on what xml is also other then that its not much more.


Thanks for the reply, I'm currently reading up more on xml and trying to figure this all out. I just don't see why it wont work. Everytime I add to the activity_main xml, the app fails to start, both on my device and emulator. The error Im getting from logcat is this:

01-28 07:25:26.608: E/AndroidRuntime(1894): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mapstutorial/com.example.mapstutorial.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.ActivityThread.access$800(ActivityThread.java:144)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.os.Handler.dispatchMessage(Handler.java:102)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.os.Looper.loop(Looper.java:135)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.ActivityThread.main(ActivityThread.java:5221)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at java.lang.reflect.Method.invoke(Native Method)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at java.lang.reflect.Method.invoke(Method.java:372)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
01-28 07:25:26.608: E/AndroidRuntime(1894): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at com.android.internal.policy.impl.Phonewindow.setContentView(Phonewindow.java:377)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.Activity.setContentView(Activity.java:2144)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at com.example.mapstutorial.MainActivity.onCreate(MainActivity.java:50)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.Activity.performCreate(Activity.java:5933)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	... 10 more
01-28 07:25:26.608: E/AndroidRuntime(1894): Caused by: java.lang.IllegalArgumentException: Binary XML file line #7: Duplicate id 0x7f070018, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2164)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
01-28 07:25:26.608: E/AndroidRuntime(1894): 	... 20 more



Was This Post Helpful? 0
  • +
  • -

#7 dermot31   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 27-January 15

Re: Android application xml confusion, help !

Posted 28 January 2015 - 01:10 AM

View Postfarrell2k, on 28 January 2015 - 12:43 AM, said:

Sure, here's some advice: If you want to display more than one object in a viewgroup, don't set both to match_parent for width and height. Other than that, you haven't given us much to the nature of your error.


Thanks for the reply. Im getting all of xml from the android website:

https://developers.g...roid/streetview

For the street view Im trying to use, it says to add the fragment with match parent for both width and height.

Why should I not be doing this ?
What should I do ?

Sorry again for the nooby questions
Was This Post Helpful? 0
  • +
  • -

#8 ben255   User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 528
  • Joined: 09-September 13

Re: Android application xml confusion, help !

Posted 28 January 2015 - 08:22 AM

youre not using FragmentManager in your code might be that.
StreetViewPanoramaFragment streetViewPanoramaFragment =
    (StreetViewPanoramaFragment) getFragmentManager()
        .findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(this);



nvm, saw it now but dunno. its copy paste code so delete and try again. try using thier fragment example istead of your own.

java.lang.IllegalArgumentException: Binary XML file line #7: Duplicate id 0x7f070018, tag null, or parent id 0x0 with another fragment for com.google.android.gms.maps.SupportMapFragment

This post has been edited by ben255: 28 January 2015 - 08:27 AM

Was This Post Helpful? 1
  • +
  • -

#9 farrell2k   User is offline

  • D.I.C Lover
  • member icon

Reputation: 874
  • View blog
  • Posts: 2,706
  • Joined: 29-July 11

Re: Android application xml confusion, help !

Posted 28 January 2015 - 10:49 AM

You need a fragment "name" tag. Line 7, first fragment.
Was This Post Helpful? 1
  • +
  • -

#10 dermot31   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 27-January 15

Re: Android application xml confusion, help !

Posted 28 January 2015 - 01:11 PM

Thanks to both of you for your help. I think I solved the error at line 7 in the xml by adding this to the second fragment:

  android:name="com.google.android.gms.maps.MapFragment"



I think my inexperience n this area has caused me a lot of frustration. I have never worked with xml before, so I intend to spend a day or two over the weekend looking at layouts in android to get a better grasp of it. I think my errors are probably due to me including stuff in my code and not properly referencing it in my xml, and vice versa. At the end of the day, it is these types of problems that will help me to learn. Im getting all sorts of nasty errors now

 01-28 19:43:42.106: E/AndroidRuntime(1862): FATAL EXCEPTION: main
01-28 19:43:42.106: E/AndroidRuntime(1862): Process: com.example.mapstutorial, PID: 1862
01-28 19:43:42.106: E/AndroidRuntime(1862): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mapstutorial/com.example.mapstutorial.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.MapFragment.getMap()' on a null object reference
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.ActivityThread.access$800(ActivityThread.java:144)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.os.Handler.dispatchMessage(Handler.java:102)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.os.Looper.loop(Looper.java:135)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.ActivityThread.main(ActivityThread.java:5221)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at java.lang.reflect.Method.invoke(Native Method)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at java.lang.reflect.Method.invoke(Method.java:372)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
01-28 19:43:42.106: E/AndroidRuntime(1862): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.MapFragment.getMap()' on a null object reference
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at com.example.mapstutorial.MainActivity.setUpMap(MainActivity.java:168)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at com.example.mapstutorial.MainActivity.onCreate(MainActivity.java:48)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.Activity.performCreate(Activity.java:5933)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
01-28 19:43:42.106: E/AndroidRuntime(1862): 	... 10 more
01-28 19:56:30.119: E/AndroidRuntime(2283): FATAL EXCEPTION: main
01-28 19:56:30.119: E/AndroidRuntime(2283): Process: com.example.mapstutorial, PID: 2283
01-28 19:56:30.119: E/AndroidRuntime(2283): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mapstutorial/com.example.mapstutorial.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.MapFragment.getMap()' on a null object reference
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.ActivityThread.access$800(ActivityThread.java:144)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.os.Handler.dispatchMessage(Handler.java:102)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.os.Looper.loop(Looper.java:135)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.ActivityThread.main(ActivityThread.java:5221)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at java.lang.reflect.Method.invoke(Native Method)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at java.lang.reflect.Method.invoke(Method.java:372)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
01-28 19:56:30.119: E/AndroidRuntime(2283): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.maps.GoogleMap com.google.android.gms.maps.MapFragment.getMap()' on a null object reference
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at com.example.mapstutorial.MainActivity.setUpMap(MainActivity.java:168)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at com.example.mapstutorial.MainActivity.onCreate(MainActivity.java:48)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.Activity.performCreate(Activity.java:5933)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
01-28 19:56:30.119: E/AndroidRuntime(2283): 	... 10 more


Was This Post Helpful? 0
  • +
  • -

#11 dermot31   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 27-January 15

Re: Android application xml confusion, help !

Posted 28 January 2015 - 01:25 PM

Great news, I looked again at the above errors and managed to solve the problem myself. I saw the error was at line 168 in my code and managed to identify the correlation of this error with my xml.

I had the class tag as

 class="com.google.android.gms.maps.SupportMapFragment"



So changed it to just MapFragment as my class actually specifies.

Thanks again guys. This has really helped me moving forward
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1