gpt4 book ai didi

java - (安卓工作室) E/Surface : getSlotFromBufferLocked: unknown buffer: 0xae6b28f0

转载 作者:太空宇宙 更新时间:2023-11-03 13:46:49 25 4
gpt4 key购买 nike

您好,我在尝试使用 android studio 在模拟器 (Nexus 5 API 23) 中模拟我的应用程序时收到此消息。

这是我的代码

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.shalahuddinn.menurestoran">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
</activity>
<activity android:name=".splashscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

启动画面.java

package com.example.shalahuddinn.menurestoran;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class splashscreen extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splashscreen);
Thread thread = new Thread() {
public void run() {
try {
sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
startActivity(new Intent(splashscreen.this, MainActivity.class));
finish();
}
}
};
thread.start();
}
}

主 Activity .java

package com.example.shalahuddinn.menurestoran;

import android.icu.text.NumberFormat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import java.util.Locale;

public class MainActivity extends AppCompatActivity {

Integer qB2 = 0;
Integer pB2;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void decrementB2 (View view) {
if (qB2>0) {
qB2 = (qB2 - 1);
displayB2(qB2);
pB2 = qB2*50000;
displaypriceB2(pB2);
}
}

public void incrementB2 (View view) {
qB2 = (qB2 + 1);
displayB2(qB2);
pB2 = qB2*50000;
displaypriceB2(pB2);

}

private void displayB2(Integer number) {
TextView quantityB2TextView = (TextView) findViewById(
R.id.quantityB2);
quantityB2TextView.setText("" + number);
}

private void displaypriceB2(Integer number) {
TextView priceB2TextView = (TextView) findViewById(
R.id.totalpriceB2);
priceB2TextView.setText("Rp "+NumberFormat.getNumberInstance(Locale.GERMANY).format(number));
}



}

问题是否来自启动画面?

最佳答案

这是Android操作系统运行marshmallow的错误,与您的代码无关,参见本期https://code.google.com/p/android/issues/detail?id=192357

尝试使用 API 24 或 25 创建一个新的模拟器

关于java - (安卓工作室) E/Surface : getSlotFromBufferLocked: unknown buffer: 0xae6b28f0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40769772/

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