add 'save as' menu to ShowRouteInformationActivity. TODO: Add save code

This commit is contained in:
sonora 2012-02-07 22:31:33 +01:00
parent c8d3c51676
commit 5a76a7edcd

View file

@ -22,6 +22,8 @@ import android.widget.ArrayAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.view.Menu;
import android.view.MenuItem;
/** /**
* *
@ -40,13 +42,12 @@ public class ShowRouteInfoActivity extends ListActivity {
lv.setId(android.R.id.list); lv.setId(android.R.id.list);
header = new TextView(this); header = new TextView(this);
helper = ((OsmandApplication)getApplication()).getRoutingHelper(); helper = ((OsmandApplication)getApplication()).getRoutingHelper();
lv.addHeaderView(header); lv.addHeaderView(header);
setContentView(lv); setContentView(lv);
dm = new DisplayMetrics(); dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm); getWindowManager().getDefaultDisplay().getMetrics(dm);
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
@ -73,7 +74,24 @@ public class ShowRouteInfoActivity extends ListActivity {
MapActivity.launchMapActivityMoveToTop(this); MapActivity.launchMapActivityMoveToTop(this);
} }
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuItem item = menu.add(0, 0, 0, getString(R.string.edit_filter_save_as_menu_item)+"...");
item.setIcon(android.R.drawable.ic_menu_save);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == 0){
//mapActivityActions.saveDirections();
} else {
return false;
}
return true;
}
class RouteInfoAdapter extends ArrayAdapter<RouteDirectionInfo> { class RouteInfoAdapter extends ArrayAdapter<RouteDirectionInfo> {
RouteInfoAdapter(List<RouteDirectionInfo> list) { RouteInfoAdapter(List<RouteDirectionInfo> list) {
@ -112,6 +130,5 @@ public class ShowRouteInfoActivity extends ListActivity {
return row; return row;
} }
} }
} }