我正在android上设置我的第一个metaio sdk应用程序,当我执行项目时,相机图像显示在主活动中,但如果我添加一个按钮,则不显示。这是主要的活动代码
package pfg.proyecto.com.proyecto;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import com.metaio.sdk.ARViewActivity;
import com.metaio.sdk.MetaioDebug;
import com.metaio.sdk.jni.IGeometry;
import com.metaio.sdk.jni.IMetaioSDKCallback;
import com.metaio.tools.io.AssetsManager;
import java.io.IOException;
public class MainActivity extends ARViewActivity {
@Override
protected int getGUILayout() {
return 0;
}
@Override
protected IMetaioSDKCallback getMetaioSDKCallbackHandler() {
return null;
}
@Override
protected void loadContents() {
}
@Override
protected void onGeometryTouched(IGeometry geometry) {
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new LoadAssets().execute();
boolean result = metaioSDK.setTrackingConfiguration("GPS", false);
MetaioDebug.log("Tracking data loaded: " + result);
}
/*@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_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.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}*/
public class LoadAssets extends AsyncTask<Void, Integer, Boolean> {
@Override
protected Boolean doInBackground(Void... params) {
try
{
// Extract all assets and overwrite existing files if debug build
AssetsManager.extractAllAssets(getApplicationContext(), BuildConfig.DEBUG);
return true;
}
catch (IOException e)
{
MetaioDebug.log(Log.ERROR, "Error extracting assets: " + e.getMessage());
MetaioDebug.printStackTrace(Log.ERROR, e);
return false;
}
}
}
}
我错过了什么?