gpt4 book ai didi

android - 按钮未显示在 metaio android 上

转载 作者:行者123 更新时间:2023-11-30 02:22:19 25 4
gpt4 key购买 nike

我正在 android 上设置我的第一个 metaio sdk 应用程序,当我执行 proyect 时,相机图像显示在主要 Activity 中,但如果我添加一个按钮,则不会显示。 这是主要 Activity 代码

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;
}
}
}
}

我错过了什么?

最佳答案

你需要在 getGUILayout 方法中返回布局文件而不是返回 0 只需将值更改为 R.layout.布局 XML 文件的名称

关于android - 按钮未显示在 metaio android 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28304921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com