Java 已接受ONNESTEDSCROLLACED的logCat中出错
我在课堂上扩展了ActionBarActivity,我有这样的错误:Java 已接受ONNESTEDSCROLLACED的logCat中出错,java,android,android-actionbaractivity,Java,Android,Android Actionbaractivity,我在课堂上扩展了ActionBarActivity,我有这样的错误: 2-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication I/dalvikvm﹕ Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.Act
2-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication I/dalvikvm﹕ Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onNestedScrollAccepted
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication W/dalvikvm﹕ VFY: unable to resolve virtual method 11481: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication I/dalvikvm﹕ Could not find method android.view.ViewGroup.onStopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onStopNestedScroll
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication W/dalvikvm﹕ VFY: unable to resolve virtual method 11487: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication I/dalvikvm﹕ Could not find method android.support.v7.internal.widget.ActionBarOverlayLayout.stopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.setHideOnContentScrollEnabled
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication W/dalvikvm﹕ VFY: unable to resolve virtual method 9172: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
02-27 09:41:59.787 1836-1836/com.application.wineot.wineotapplication D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000e
02-27 09:41:59.791 1836-1836/com.application.wineot.wineotapplication I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
02-27 09:41:59.791 1836-1836/com.application.wineot.wineotapplication W/dalvikvm﹕ VFY: unable to resolve virtual method 455: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
02-27 09:41:59.791 1836-1836/com.application.wineot.wineotapplication D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
02-27 09:41:59.791 1836-1836/com.application.wineot.wineotapplication I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
02-27 09:41:59.791 1836-1836/com.application.wineot.wineotapplication W/dalvikvm﹕ VFY: unable to resolve virtual method 477: Landroid/content/res/TypedArray;.getType (I)I
02-27 09:41:59.791 1836-1836/com.application.wineot.wineotapplication D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
我不知道为什么会出现这个错误
我也在课堂上展示了我的代码:
import android.app.FragmentTransaction;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import com.application.wineot.wineotapplication.MainActivity;
import com.application.wineot.wineotapplication.R;
import Fonction.CustomToast;
import Fonction.menuListAdapter;
import contactUs.ContactUs;
import myBottles.MyBottles;
import takepicture.TakePictureBottle;
公共类MyAccount扩展了ActionBarActivity{
//Use for the left menu
String[] menu;
DrawerLayout dLayout;
ListView dList;
//use drawerLayout and drawerToggle to have an animation on the left menu
DrawerLayout drawerLayout;
ActionBarDrawerToggle drawerToggle;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_account);
if (savedInstanceState == null) {
MyAccountFragment fragmentMyAccountFragment = new MyAccountFragment();
getFragmentManager().beginTransaction().replace(R.id.content_my_account, fragmentMyAccountFragment).setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).addToBackStack(null).commit();
}
//use animation of the left menu
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.app_name, R.string.app_name) {};
drawerLayout.setDrawerListener(drawerToggle);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
//set menu Left and the activity linked
menu = new String[]{"My account","Scan a bottle","My bottles","Contact Us","Logout"};
dLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
dList = (ListView) findViewById(R.id.menu_left);
this.dList.setAdapter(new menuListAdapter(menu, getResources().getIntArray(R.array.nav_drawer_icons_menu_left), getLayoutInflater()));
dList.setSelector(R.color.bordeaux);
dList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View v, int position, long id) {
dLayout.closeDrawers();
Bundle args = new Bundle();
args.putString("Menu", menu[position]);
if (menu[position].equals("My account"))
{
//Toast is a view containing a quick little message for the user
new CustomToast(getString(R.string.MyAccountAlreday), getLayoutInflater(), (ViewGroup) findViewById(R.id.toast_layout), getApplicationContext());
}
if (menu[position].equals("Scan a bottle"))
startActivity(new Intent(MyAccount.this, TakePictureBottle.class));
if (menu[position].equals("My bottles"))
startActivity(new Intent(MyAccount.this, MyBottles.class));
if (menu[position].equals("Contact Us"))
startActivity(new Intent(MyAccount.this, ContactUs.class));
if (menu[position].equals("Logout"))
startActivity(new Intent(MyAccount.this, MainActivity.class));
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
return drawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
drawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
drawerToggle.onConfigurationChanged(newConfig);
}
如果有人知道这个错误以及我是如何解决这个问题的:你是否过滤了你的日志猫或者没有发布所有的日志?是的,但是错误来自同一个错误