首页 \ 问答 \ NoSuchMethodException - PerfIOPrefetchStart(NoSuchMethodException - PerfIOPrefetchStart)

NoSuchMethodException - PerfIOPrefetchStart(NoSuchMethodException - PerfIOPrefetchStart)

我的RecyclerViews没有显示在这个活动中,所以当我在手机上运行应用程序时,我看到了LogCat,只是注意到这个错误:你们中的任何一个人知道它来自哪里? 它似乎(根据其他职位在这里),它可以链接到Context()SharedPreferences但我不明白他们的用途会出错:

活动

package com.olirwin.spartacus.deutsch;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.ArrayList;

public class players extends AppCompatActivity {

ArrayList<String> playerNames;
Button send;
PlayerAdapter Adapter;
RecyclerView playerList;
String[] names;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_players);

    playerNames = new ArrayList<String>();

    final ArrayList<Player> players = new ArrayList<Player>();
    send = findViewById(R.id.b_send);



    Bundle extra = new Bundle();
    final int numPlayers = extra.getInt("numPlayers");
    System.out.println(numPlayers);
    for (int i = 0; i < numPlayers; i++)
    {
        playerNames.add("Joueur " + (i+1) + " : ");
    }
    playerList = findViewById(R.id.player_list);
    playerList.setLayoutManager(new LinearLayoutManager(this));
    Adapter = new PlayerAdapter(playerNames,this);
    playerList.setAdapter(Adapter);
    names = new String[numPlayers];



    Adapter.notifyDataSetChanged();

    send.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            for (int i = 0; i < numPlayers; i++) {
                players.add(new Player(names[i]));
            }

            Intent intent = new Intent(view.getContext(), Score.class);
            intent.putExtra("players", players);
            view.getContext().startActivity(intent);
        }
    });

}



private class PlayerAdapter extends
        RecyclerView.Adapter<PlayerAdapter.PlayerHolder> {
    private ArrayList<String> playerNames;
    private Context context;

    public PlayerAdapter (ArrayList<String> playerNames, Context context) {
        this.playerNames = playerNames;
        this.context = context;
    }

    @Override
    public PlayerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v =

LayoutInflater.from(players.this).inflate(R.layout.list_cell, parent,
                        false);
        return new PlayerHolder(v);
    }


    @Override
    public void onBindViewHolder(PlayerHolder holder, final int position) {
        holder.bind(this.playerNames.get(position));

        holder.mPlayerName.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int
                    start, int before,
                                          int count) {
                names[position] = charSequence.toString();
            }

            @Override
            public void onTextChanged(CharSequence charSequence, int start,
                                      int before,
                                      int count){

            }

            @Override
            public void afterTextChanged(Editable editable) {

            }
        });



    }

    @Override
    public int getItemCount() {
        return playerNames.size();
    }



    public class PlayerHolder extends RecyclerView.ViewHolder {

        TextView mPlayerLabel;
        EditText mPlayerName;


        public PlayerHolder(View itemView) {
            super(itemView);
            mPlayerLabel = itemView.findViewById(R.id.player_label);
            mPlayerName = itemView.findViewById(R.id.player_name);
        }

        public void bind(String playerName) {
            mPlayerLabel.setText(playerName);
            mPlayerName.setHint("Nom de " + playerName);
        }

        public String getData(){
            return mPlayerName.getText().toString();
        }

    }
}
}

logcat的

02-28 14:13:46.476 17413-17413/? I/zygote64: Late-enabling -Xcheck:jni
02-28 14:13:46.514 17413-17449/? E/zygote64: Failed sending reply to             debugger: Broken pipe
02-28 14:13:46.515 17413-17449/? I/zygote64: Debugger is no longer active
02-28 14:13:46.597 17413-17413/? D/Embryo: preload     com.olirwin.spartacus.deutsch, 30ms, hwui=true, layout=false, decor=false
02-28 14:13:46.604 17413-17467/? I/Adreno: QUALCOMM build                   : 076f837, I801ffd6741
                                       Build Date                       :     10/24/17
                                       OpenGL ES Shader Compiler Version:     EV031.20.00.04
                                       Local Branch                     : 
                                       Remote Branch                    : 
                                       Remote Branch                    : 
                                       Reconstruct Branch               : 
02-28 14:13:46.604 17413-17467/? I/vndksupport: sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8998.so from the current namespace instead.
02-28 14:13:46.601 17413-17413/? W/RenderThread: type=1400 audit(0.0:141319): avc: denied { search } for name="proc" dev="debugfs" ino=16971 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
02-28 14:13:46.609 17413-17467/? I/Adreno: PFP: 0x005ff087, ME: 0x005ff063
02-28 14:13:46.615 17413-17467/? I/OpenGLRenderer: Initialized EGL, version 1.4
02-28 14:13:46.615 17413-17467/? D/OpenGLRenderer: HWUI GL Pipeline
02-28 14:13:46.615 17413-17467/? D/OpenGLRenderer: Swap behavior 2
02-28 14:13:46.817 17413-17413/? E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:46.817 17413-17413/? E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:46.914 17413-17413/? D/AppTracker: App Event: start
02-28 14:13:47.012 17413-17467/? I/vndksupport: sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8998.so from the current namespace instead.
02-28 14:13:49.884 17413-17413/com.olirwin.spartacus.deutsch D/AppTracker: App Event: stop
02-28 14:13:49.906 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.906 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.909 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Do partial code cache collection, code=30KB, data=25KB
02-28 14:13:49.909 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: After     code cache collection, code=30KB, data=25KB
02-28 14:13:49.909 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Increasing code cache capacity to 128KB
02-28 14:13:49.917 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.917 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.923 17413-17413/com.olirwin.spartacus.deutsch I/System.out: 0
02-28 14:13:49.927 17413-17413/com.olirwin.spartacus.deutsch D/AppTracker: App Event: start
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Do partial code cache collection, code=37KB, data=47KB
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: After code cache collection, code=37KB, data=47KB
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Increasing code cache capacity to 256KB
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Compiler allocated 4MB to compile void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
02-28 14:13:49.995 17413-17467/com.olirwin.spartacus.deutsch D/OpenGLRenderer: endAllActiveAnimators on 0x761eeb1400 (RippleDrawable) with handle 0x761e894f60
02-28 14:14:49.808 17413-17413/com.olirwin.spartacus.deutsch D/AppTracker: App Event: stop

My RecyclerViews are not showing in this activity, so I had a look in the LogCat when I was running the app on my phone, only to notice this error : do any of you know where it's from ? It seems (according to other posts here) that it could be linked to Context() or SharedPreferences but I can't see where their use would go wrong :

Activity

package com.olirwin.spartacus.deutsch;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.ArrayList;

public class players extends AppCompatActivity {

ArrayList<String> playerNames;
Button send;
PlayerAdapter Adapter;
RecyclerView playerList;
String[] names;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_players);

    playerNames = new ArrayList<String>();

    final ArrayList<Player> players = new ArrayList<Player>();
    send = findViewById(R.id.b_send);



    Bundle extra = new Bundle();
    final int numPlayers = extra.getInt("numPlayers");
    System.out.println(numPlayers);
    for (int i = 0; i < numPlayers; i++)
    {
        playerNames.add("Joueur " + (i+1) + " : ");
    }
    playerList = findViewById(R.id.player_list);
    playerList.setLayoutManager(new LinearLayoutManager(this));
    Adapter = new PlayerAdapter(playerNames,this);
    playerList.setAdapter(Adapter);
    names = new String[numPlayers];



    Adapter.notifyDataSetChanged();

    send.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            for (int i = 0; i < numPlayers; i++) {
                players.add(new Player(names[i]));
            }

            Intent intent = new Intent(view.getContext(), Score.class);
            intent.putExtra("players", players);
            view.getContext().startActivity(intent);
        }
    });

}



private class PlayerAdapter extends
        RecyclerView.Adapter<PlayerAdapter.PlayerHolder> {
    private ArrayList<String> playerNames;
    private Context context;

    public PlayerAdapter (ArrayList<String> playerNames, Context context) {
        this.playerNames = playerNames;
        this.context = context;
    }

    @Override
    public PlayerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v =

LayoutInflater.from(players.this).inflate(R.layout.list_cell, parent,
                        false);
        return new PlayerHolder(v);
    }


    @Override
    public void onBindViewHolder(PlayerHolder holder, final int position) {
        holder.bind(this.playerNames.get(position));

        holder.mPlayerName.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int
                    start, int before,
                                          int count) {
                names[position] = charSequence.toString();
            }

            @Override
            public void onTextChanged(CharSequence charSequence, int start,
                                      int before,
                                      int count){

            }

            @Override
            public void afterTextChanged(Editable editable) {

            }
        });



    }

    @Override
    public int getItemCount() {
        return playerNames.size();
    }



    public class PlayerHolder extends RecyclerView.ViewHolder {

        TextView mPlayerLabel;
        EditText mPlayerName;


        public PlayerHolder(View itemView) {
            super(itemView);
            mPlayerLabel = itemView.findViewById(R.id.player_label);
            mPlayerName = itemView.findViewById(R.id.player_name);
        }

        public void bind(String playerName) {
            mPlayerLabel.setText(playerName);
            mPlayerName.setHint("Nom de " + playerName);
        }

        public String getData(){
            return mPlayerName.getText().toString();
        }

    }
}
}

LogCat

02-28 14:13:46.476 17413-17413/? I/zygote64: Late-enabling -Xcheck:jni
02-28 14:13:46.514 17413-17449/? E/zygote64: Failed sending reply to             debugger: Broken pipe
02-28 14:13:46.515 17413-17449/? I/zygote64: Debugger is no longer active
02-28 14:13:46.597 17413-17413/? D/Embryo: preload     com.olirwin.spartacus.deutsch, 30ms, hwui=true, layout=false, decor=false
02-28 14:13:46.604 17413-17467/? I/Adreno: QUALCOMM build                   : 076f837, I801ffd6741
                                       Build Date                       :     10/24/17
                                       OpenGL ES Shader Compiler Version:     EV031.20.00.04
                                       Local Branch                     : 
                                       Remote Branch                    : 
                                       Remote Branch                    : 
                                       Reconstruct Branch               : 
02-28 14:13:46.604 17413-17467/? I/vndksupport: sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8998.so from the current namespace instead.
02-28 14:13:46.601 17413-17413/? W/RenderThread: type=1400 audit(0.0:141319): avc: denied { search } for name="proc" dev="debugfs" ino=16971 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
02-28 14:13:46.609 17413-17467/? I/Adreno: PFP: 0x005ff087, ME: 0x005ff063
02-28 14:13:46.615 17413-17467/? I/OpenGLRenderer: Initialized EGL, version 1.4
02-28 14:13:46.615 17413-17467/? D/OpenGLRenderer: HWUI GL Pipeline
02-28 14:13:46.615 17413-17467/? D/OpenGLRenderer: Swap behavior 2
02-28 14:13:46.817 17413-17413/? E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:46.817 17413-17413/? E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:46.914 17413-17413/? D/AppTracker: App Event: start
02-28 14:13:47.012 17413-17467/? I/vndksupport: sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8998.so from the current namespace instead.
02-28 14:13:49.884 17413-17413/com.olirwin.spartacus.deutsch D/AppTracker: App Event: stop
02-28 14:13:49.906 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.906 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.909 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Do partial code cache collection, code=30KB, data=25KB
02-28 14:13:49.909 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: After     code cache collection, code=30KB, data=25KB
02-28 14:13:49.909 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Increasing code cache capacity to 128KB
02-28 14:13:49.917 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.917 17413-17413/com.olirwin.spartacus.deutsch E/BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-28 14:13:49.923 17413-17413/com.olirwin.spartacus.deutsch I/System.out: 0
02-28 14:13:49.927 17413-17413/com.olirwin.spartacus.deutsch D/AppTracker: App Event: start
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Do partial code cache collection, code=37KB, data=47KB
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: After code cache collection, code=37KB, data=47KB
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Increasing code cache capacity to 256KB
02-28 14:13:49.990 17413-17447/com.olirwin.spartacus.deutsch I/zygote64: Compiler allocated 4MB to compile void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
02-28 14:13:49.995 17413-17467/com.olirwin.spartacus.deutsch D/OpenGLRenderer: endAllActiveAnimators on 0x761eeb1400 (RippleDrawable) with handle 0x761e894f60
02-28 14:14:49.808 17413-17413/com.olirwin.spartacus.deutsch D/AppTracker: App Event: stop

原文:https://stackoverflow.com/questions/49030599
更新时间:2022-06-29 09:06

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。