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()
orSharedPreferences
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