Hi i am new to android..
i have the following code..
package squash.trainer;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
public class SquashTrainerActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Button btn_start = (Button) findViewById(R.id.btn_start);
//btn_start.setOnClickListener(new View.OnClickListener() {
// public void onClick(View v) {
// setContentView(R.layout.selecttopmenu);
// }});
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater. inflate(R.menu.mainmenu, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item. getItemId() ) {
case R. id.btn1:
BugsSequence();
return true;
case R. id.btn2:
return true;
case R. id.btn3:
return true;
case R. id.btn4:
return true;
default:
return super. onOptionsItemSelected(item) ;
}
}
private void BugsSequence() {
// TODO Auto-generated method stub
}
}
for each case i want to use the a class to load the new layout and logic...
currently i have a test class called Bugssequence
package squash.trainer;
import android.os.Bundle;
import android.app.Activity;
//import android.view.View;
//import android.widget.Button;
public class BugsSequence extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
//super.onCreate(savedInstanceState);
setContentView(R.layout.selecttopmenu);
}
/**
* #param args
*/
public static void main(String[] args) {
//
}
}
How can i get it load the new layout.. when i press on button 1.. it does nothing..
or is there a better way to load 4 different layouts /class(logic) one for each of the menus. Should i even be creating new activities for each screen / layout ?
Thanks you for your assistance...
Complete guide can be found here: http://developer.android.com/guide/topics/fundamentals/activities.html
At first, your activity should be declared in the manifest
<activity android:name=".YourActivity"
android:label="#string/youractivitylabel">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
and then you can start YourActivity from code:
Intent intent = new Intent(this, YourActivity.class);
startActivity(intent);
You can put easily some extra data into the intent and/or start it for a result
startActivityForResult(intent, PICK_CONTACT_REQUEST);
Read the link above, it's very useful!
Related
I need to put a list of items in different pages that can be selected through checkboxes and radio buttons and the overall price (addition of each selected item) should be added to the main page.
How can I do this?
here's my code for the main page:
package com.example.mcdonalds;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;
public class MenuPage extends Activity {
private static final String CheckBox = null;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu_page);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_page, menu);
return true;
}
public void gotoBeefPage(View view) {
Intent intent1 = new Intent(this,BeefPage.class);
startActivity(intent1);
}
public void gotoChickenPage(View view) {
Intent intent2 = new Intent(this,ChickenPage.class);
startActivity(intent2);
}
public void gotoKidsMenu(View view) {
Intent intent3 = new Intent(this,KidsMenu.class);
startActivity(intent3);
}
public void gotoDessertPage(View view) {
Intent intent4 = new Intent(this,DessertPage.class);
startActivity(intent4);
}
and here's a code for one of the pages that contains checkboxes:
package com.example.mcdonalds;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.CheckBox;
public class BeefPage extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_beef_page);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.beef_page, menu);
return true;
}
If I understand your question correctly, you're creating an app where the user can go to the different pages, add their dishes (1 beef, 2 chicken, 2 desserts, etc.), and then return to the main page for a summary of their order with a total price?
It seems like you're trying to solve this problem entirely in the view (Activity) code. The better way to structure it is to have all our activities operate on a shared Data Model object. You can even have your main activity create the object and then pass it to the individual sub-activities through the Intent.
Modifying your code:
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;
public class MenuPage extends Activity {
private static final String CheckBox = null;
private Order myOrder = null;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu_page);
this.myOrder = new Order();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_page, menu);
return true;
}
public void gotoBeefPage(View view) {
Intent intent1 = new Intent(this,BeefPage.class);
intent1.putExtra("Order",this.myOrder);
startActivityForResult(intent1, requestCode);
}
public void gotoChickenPage(View view) {
Intent intent2 = new Intent(this,ChickenPage.class);
intent2.putExtra("Order",this.myOrder);
startActivityForResult(intent2, requestCode);
}
public void gotoKidsMenu(View view) {
Intent intent3 = new Intent(this,KidsMenu.class);
intent3.putExtra("Order",this.myOrder);
startActivityForResult(intent3, requestCode);
}
public void gotoDessertPage(View view) {
Intent intent4 = new Intent(this,DessertPage.class);
intent4.putExtra("Order",this.myOrder);
startActivityForResult(intent4, requestCode);
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
// Update your local copy of myOrder with what you return in data.
}
You will have to make sure that your Order object conforms to the Parcelable or Bundle interfaces in order to pass it through an intent (I think you can also use Serializable).
I created a simple demo program in which there is start button.When i click on start button on main (Home) screen "hi all" appended to Text view.It works fine, But when I change the activity from selecting action bar menu and if again come on the home screen by selecting the action bar home menu then it will not show the "hi all " Message when I click on the Start button.
package com.example.testdemo;
import android.app.ActionBar.LayoutParams;
import android.content.Intent;
import android.os.Bundle;
import android.app.ActionBar;
import android.app.Activity;
import android.text.method.ScrollingMovementMethod;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView logArea;
private TextView log;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
ActionBar actionBar = getActionBar();
log = new TextView(MainActivity.this);
log.append("Heollosdfsjdf" + "\n");
#SuppressWarnings("deprecation")
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
params.gravity = Gravity.LEFT;
log.setLayoutParams(params);
log.setGravity(Gravity.CENTER);
LinearLayout chat = (LinearLayout) findViewById(R.id.main_linear_view);
log.setMovementMethod(new ScrollingMovementMethod());
chat.addView(log);
setDefault();
}
public void setDefault(){
Button btn = (Button) findViewById(R.id.start_recording_button);
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
startWriting(v);
}
});
}
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;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.home:
goHome();
return true;
case R.id.general_setting:
generalSetting();
return true;
case R.id.server_settings:
serverSetting();
return true;
case R.id.audio_settings:
audioSetting();
return true;
default:
break;
}
return true;
}
private void goHome() {
Intent i = new Intent(MainActivity.this, home.class);
startActivity(i);
finish();
}
private void generalSetting() {
Intent i = new Intent(MainActivity.this, general.class);
startActivity(i);
finish();
}
private void audioSetting() {
Intent i = new Intent(MainActivity.this, audio.class);
startActivity(i);
finish();
}
private void serverSetting() {
Intent i = new Intent(MainActivity.this, server.class);
startActivity(i);
finish();
}
public void startWriting(View view) {
logMessage("Hi all");
}
private void logMessage(String msg) {
log.append(msg + "\n");
final int scrollAmount = log.getLayout().getLineTop(log.getLineCount())- log.getHeight();
if (scrollAmount > 0)
log.scrollTo(0, scrollAmount);
else
log.scrollTo(0, 0);
}
}
it's because you called 'finish' when you changed activities. calling the main activity again reloads its view to its initial state.
In addition to MetaSnarf's answer: For a deeper understanding of the "Android Task Stack" and saving of the current Activity state, you might want to take a look at http://developer.android.com/guide/components/tasks-and-back-stack.html
Im using intents to pass the noteId from my database to a different activity for displaying the information it was working and i went to work on another part of the project and now it seems to only pass one value and from playing about i have found that seems to be whatever is the next highest object on the ListView. Sorry if this is badly worded, Im not very good at explaining these things
ViewNote Class
package com.hardy.passnotes;
import java.util.HashMap;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class ViewNote extends Activity {
EditText NewNoteTitle;
EditText NewNoteContent;
TextView tvNoteId;
DBTools dbTools = new DBTools(this);
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_view_note);
NewNoteTitle = (EditText)findViewById(R.id.ETNewNoteTitle);
NewNoteContent = (EditText)findViewById(R.id.ETNewNoteContent);
Intent n = getIntent();
String NoteId = n.getStringExtra("noteId");
Toast.makeText(getApplicationContext(), NoteId,
Toast.LENGTH_LONG).show();
HashMap<String, String> NoteList = dbTools.getNoteInfo(NoteId);
if(NoteList.size() != 0)
{
setTitle("Note: " + NoteList.get("noteTitle"));
NewNoteTitle.setText(NoteList.get("noteTitle"));
NewNoteContent.setText(NoteList.get("noteContent"));
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.view_note, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId())
{
case R.id.action_Editnote:
tvNoteId = (TextView)findViewById(R.id.NoteId);
String NoteValue = tvNoteId.getText().toString();
Intent intent = new Intent(getApplication(),EditNote.class);
intent.putExtra("noteId", NoteValue);
startActivity(intent);
case R.id.action_DelNote:
Intent intent1 = getIntent();
String NoteId = intent1.getStringExtra("noteId");
dbTools.deleteNote(NoteId);
Intent i = new Intent(getApplication(),MyNotes.class);
startActivity(i);
finish();
}
return super.onOptionsItemSelected(item);
}
}
MyNote Class:
package com.hardy.passnotes;
import java.util.ArrayList;
import java.util.HashMap;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
public class MyNotes extends ListActivity {
DBTools dbTools = new DBTools(this);
TextView tvNoteId;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_notes);
Log.i("Tag", "OnCreate Started As Normal");
setTitle("My Notes");
ArrayList <HashMap<String, String>> NoteList = dbTools.getAllNotes();
if(NoteList.size() != 0)
{
ListView listView = getListView();
listView.setOnItemClickListener(new OnItemClickListener()
{
#Override
public void onItemClick(AdapterView<?> arg0, View view,
int position, long id) {
tvNoteId = (TextView)findViewById(R.id.NoteId);
String NoteValue = tvNoteId.getText().toString();
Intent intent = new Intent(MyNotes.this,ViewNote.class);
intent.putExtra("noteId", NoteValue);
startActivity(intent);
Log.i("Tag", "if Started As Normal");
}
});
ListAdapter Adapter = new SimpleAdapter(MyNotes.this,NoteList,R.layout.notes_list, new String[]{"noteId","noteTitle",}, new int[]{R.id.NoteId,R.id.NoteTitle} );
setListAdapter(Adapter);
Log.i("Tag", "Arrey Started As Normal");
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.my_notes, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId())
{
case R.id.action_Add:
Intent i = new Intent(getApplicationContext(),CreateNote.class);
startActivity(i);
finish();
}
return super.onOptionsItemSelected(item);
}
}
Thanks in advance been searching around and debugging for hours with no luck.
Hi I think the problem is that you use the findViewById() method inappropriately in your onItemClick listener.
You should use:
tvNoteId = (TextView)view.findViewById(R.id.NoteId);
Notice that I call the findViewById method on the view given by the onItemClick method because you want to find the view with the id NoteId from the pressed item and not from the entire's activity content view.. the way you do it will search in the content view of your activity for the first id equal with NoteId ...
I think your note get deleted on the moment edit is clicked from the options menu.
At the end of case R.id.action_Editnote nothing is returned nor break is called so case R.id.action_Delnote will be executed as well. This is where you delete the note from your database.
In your switch, put a break:
switch (item.getItemId())
{
case R.id.action_Editnote:
tvNoteId = (TextView)findViewById(R.id.NoteId);
String NoteValue = tvNoteId.getText().toString();
Intent intent = new Intent(getApplication(),EditNote.class);
intent.putExtra("noteId", NoteValue);
startActivity(intent);
break;
case R.id.action_DelNote:
Intent intent1 = getIntent();
String NoteId = intent1.getStringExtra("noteId");
dbTools.deleteNote(NoteId);
Intent i = new Intent(getApplication(),MyNotes.class);
startActivity(i);
finish();
break;
}
I have a program and when I try to start it, it crashes. I really don't understand why, even Eclipse show's that there are no errors.
I can show you the code of a page on which I think is the problem.
package ctect.android.maxipro;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class BasicScreenActivity extends Activity {
private Button butonul1;
private Button butonul2;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_basic_screen);
butonul1.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View currentView) {
// TODO Auto-generated method stub
butonul2.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View currentView) {
// TODO Auto-generated method stub
Intent myIntent = new Intent(currentView.getContext(), NeedForSpeedActivity.class);
startActivityForResult(myIntent, 0);
Intent myIntent2 = new Intent(currentView.getContext(), Fifa2012Activity.class);
startActivityForResult(myIntent2, 0);
}
});
}
});
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.basic_screen, menu);
return true;
}
}
if somebody understands, please help me.
You forgot to assign an object to butonul1 before using it. You need to add this line before butonul1.setOnClickListener:
butonul1= (Button) findViewById(R.id.butonul1);
This is assuming that you gave it the id butonul1 in your layout file.
I've set up the http://bingmapsandroidsdk.codeplex.com/ to try bing maps instead of google maps on Android. Because I was unable to set that up.
I'm able to run Bing maps on my emulator but I'm unable to run it on my device(Galaxy S2).
I have a wifi connection on my phone but I'm still unable to get past the load screen.
I also checked this question but it doesn't solve the problem Working on Emulator but not on the real Android device
So my code:
Manifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.ACCESS_GPS"></uses-permission>
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="15"/>
<application android:icon="#drawable/bingmaps_icon" android:label="#string/app_name" android:allowBackup="false">
<activity android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="SplashActivity"></activity>
</application>
Starting Activity copied from the Bing-sdk
package org.bingmaps.app;
import java.util.HashMap;
import org.bingmaps.app.R;
import org.bingmaps.sdk.BingMapsView;
import org.bingmaps.sdk.Coordinate;
import org.bingmaps.sdk.EntityClickedListener;
import org.bingmaps.sdk.EntityLayer;
import org.bingmaps.sdk.MapLoadedListener;
import org.bingmaps.sdk.MapMovedListener;
import org.bingmaps.sdk.MapStyles;
import org.bingmaps.sdk.Pushpin;
import org.bingmaps.sdk.PushpinOptions;
import android.app.Activity;
import android.app.ProgressDialog;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ViewFlipper;
import android.widget.ZoomButton;
public class MainActivity extends Activity {
private BingMapsView bingMapsView;
private GPSManager _GPSManager;
private EntityLayer _gpsLayer;
private ProgressDialog _loadingScreen;
private Activity _baseActivity;
CharSequence[] _dataLayers;
boolean[] _dataLayerSelections;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
//OPTION Lock map orientation
setRequestedOrientation(1);
setContentView(R.layout.main);
Initialize();
}
private void Initialize()
{
_baseActivity = this;
_GPSManager = new GPSManager((Activity)this, new GPSLocationListener());
//Add more data layers here
_dataLayers = new String[] { getString(R.string.traffic)};
_dataLayerSelections = new boolean[ _dataLayers.length ];
_loadingScreen = new ProgressDialog(this);
_loadingScreen.setCancelable(false);
_loadingScreen.setMessage(this.getString(R.string.loading) + "...");
bingMapsView = (BingMapsView) findViewById(R.id.mapView);
//Create handler to switch out of Splash screen mode
final Handler viewHandler = new Handler() {
public void handleMessage(Message msg) {
((ViewFlipper) findViewById(R.id.flipper)).setDisplayedChild(1);
}
};
//Add a map loaded event handler
bingMapsView.setMapLoadedListener(new MapLoadedListener() {
public void onAvailableChecked() {
// hide splash screen and go to map
viewHandler.sendEmptyMessage(0);
//Add GPS layer
_gpsLayer = new EntityLayer(Constants.DataLayers.GPS);
bingMapsView.getLayerManager().addLayer(_gpsLayer);
UpdateGPSPin();
}
});
//Add a entity clicked event handler
bingMapsView.setEntityClickedListener(new EntityClickedListener() {
public void onAvailableChecked(String layerName, int entityId) {
HashMap<String, Object> metadata = bingMapsView.getLayerManager().GetMetadataByID(layerName, entityId);
DialogLauncher.LaunchEntityDetailsDialog(_baseActivity, metadata);
}
});
//Load the map
bingMapsView.loadMap(Constants.BingMapsKey, _GPSManager.GetCoordinate(), Constants.DefaultGPSZoomLevel, this.getString(R.string.mapCulture));
// Create zoom out button functionality
final ZoomButton zoomOutBtn = (ZoomButton) findViewById(R.id.zoomOutBtn);
zoomOutBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
bingMapsView.zoomOut();
}
});
// Create zoom button in functionality
final ZoomButton zoomInBtn = (ZoomButton) findViewById(R.id.zoomInBtn);
zoomInBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
bingMapsView.zoomIn();
}
});
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.layout.menu, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
//Map Mode menu items
case R.id.autoBtn:
bingMapsView.setMapStyle(MapStyles.Auto);
item.setChecked(!item.isChecked());
return true;
case R.id.roadBtn:
bingMapsView.setMapStyle(MapStyles.Road);
item.setChecked(!item.isChecked());
return true;
case R.id.aerialBtn:
bingMapsView.setMapStyle(MapStyles.Aerial);
item.setChecked(!item.isChecked());
return true;
case R.id.birdseyeBtn:
bingMapsView.setMapStyle(MapStyles.Birdseye);
item.setChecked(!item.isChecked());
return true;
//More option items
case R.id.aboutMenuBtn:
DialogLauncher.LaunchAboutDialog(this);
return true;
case R.id.layersMenuBtn:
DialogLauncher.LaunchLayersDialog(this, bingMapsView, _dataLayers, _dataLayerSelections);
return true;
case R.id.clearMapMenuBtn:
bingMapsView.getLayerManager().clearLayer(null);
//unselect all layers
for(int i=0;i<_dataLayerSelections.length;i++){
_dataLayerSelections[i] = false;
}
//re-add GPS layer
bingMapsView.getLayerManager().clearLayer(Constants.DataLayers.GPS);
UpdateGPSPin();
return true;
//GPS Menu Item
case R.id.gpsMenuBtn:
Coordinate coord = _GPSManager.GetCoordinate();
if(coord != null){
//Center on users GPS location
bingMapsView.setCenterAndZoom(coord, Constants.DefaultGPSZoomLevel);
}
return true;
//Search Menu Item
case R.id.searchMenuBtn:
DialogLauncher.LaunchSearchDialog(this, bingMapsView, loadingScreenHandler);
return true;
//Directions Menu Item
case R.id.directionsMenuBtn:
DialogLauncher.LaunchDirectionsDialog(this, bingMapsView, loadingScreenHandler);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void UpdateGPSPin(){
PushpinOptions opt = new PushpinOptions();
opt.Icon = Constants.PushpinIcons.GPS;
Pushpin p = new Pushpin(_GPSManager.GetCoordinate(), opt);
if (p.Location != null) {
_gpsLayer.clear();
_gpsLayer.add(p);
_gpsLayer.updateLayer();
}
}
#SuppressWarnings("unused")
private final MapMovedListener mapMovedListener = new MapMovedListener() {
public void onAvailableChecked() {
//OPTION Add logic to Update Layers here.
//This will update data layers when the map is moved.
}
};
/**
* Handler for loading Screen
*/
protected Handler loadingScreenHandler = new Handler() {
public void handleMessage(Message msg) {
if (msg.arg1 == 0) {
_loadingScreen.hide();
} else {
_loadingScreen.show();
}
}
};
public class GPSLocationListener implements LocationListener {
public void onLocationChanged(Location arg0) {
UpdateGPSPin();
}
public void onProviderDisabled(String arg0) {
}
public void onProviderEnabled(String arg0) {
}
public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
}
}
}
ERRORS from LOGCAT: non
bing maps for android does not work for android versions 3.0 and higher