[Android]

- Fix code style;
- Remove AndroidFramework creation (segfault);
This commit is contained in:
vng 2011-06-26 13:56:27 +03:00 committed by Alex Zolotarev
parent e6cf77512c
commit db89d52ae9
2 changed files with 24 additions and 16 deletions

View file

@ -21,7 +21,7 @@ extern "C"
GetAndroidPlatform().Initialize(env, thiz, path);
g_work = new AndroidFramework();
//g_work = new AndroidFramework();
}
///////////////////////////////////////////////////////////////////////////////////
@ -31,7 +31,7 @@ extern "C"
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MainGLView_nativeInit(JNIEnv * env, jobject thiz)
{
g_work->SetParentView(env, thiz);
//g_work->SetParentView(env, thiz);
}
JNIEXPORT void JNICALL

View file

@ -8,9 +8,12 @@ import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.util.Log;
public class MWMActivity extends Activity
{
private static String TAG = "MWMActivity";
private MainGLView m_view;
private String getResourcePath()
@ -45,23 +48,28 @@ public class MWMActivity extends Activity
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
return true;
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.my_position:
return true;
case R.id.download_maps:
return true;
default:
return super.onOptionsItemSelected(item);
}
public boolean onOptionsItemSelected(MenuItem item)
{
// Handle item selection
switch (item.getItemId())
{
case R.id.my_position:
Log.i(TAG, "onMyPosition");
return true;
case R.id.download_maps:
Log.i(TAG, "onDownloadMaps");
return true;
default:
return super.onOptionsItemSelected(item);
}
}
static