E/Surface(11901): Surface (identity=16464) requestBuffer(1, 0, 0, 0, 00000033)
returned a buffer with a null handle
E/Surface(11901): getBufferLocked(1, 0, 0, 0, 00000033) failed (Out of memory)
E/Surface(11901): dequeueBuffer failed (Out of memory)
E/ViewRoot(11901): OutOfResourcesException locking surface
E/ViewRoot(11901): android.view.Surface$OutOfResourcesException
E/ViewRoot(11901): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRoot(11901): at android.view.Surface.lockCanvas(Surface.java:314)
E/ViewRoot(11901): at android.view.ViewRoot.draw(ViewRoot.java:1467)
E/ViewRoot(11901): at android.view.ViewRoot.performTraversals(ViewRoot.java:1260)
E/ViewRoot(11901): at android.view.ViewRoot.handleMessage(ViewRoot.java:1873)
E/ViewRoot(11901): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRoot(11901): at android.os.Looper.loop(Looper.java:130)
E/ViewRoot(11901): at android.app.ActivityThread.main(ActivityThread.java:3703)
E/ViewRoot(11901): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRoot(11901): at java.lang.reflect.Method.invoke(Method.java:507)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller
.run(ZygoteInit.java:841)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/ViewRoot(11901): at dalvik.system.NativeStart.main(Native Method)
E/Surface(11901): Surface (identity=16461) requestBuffer(1, 0, 0, 0, 00000033)
returned a buffer with a null handle
E/Surface(11901): getBufferLocked(1, 0, 0, 0, 00000033) failed (Out of memory)
E/Surface(11901): dequeueBuffer failed (Out of memory)
E/ViewRoot(11901): OutOfResourcesException locking surface
E/ViewRoot(11901): android.view.Surface$OutOfResourcesException
E/ViewRoot(11901): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRoot(11901): at android.view.Surface.lockCanvas(Surface.java:314)
E/ViewRoot(11901): at android.view.ViewRoot.draw(ViewRoot.java:1467)
E/ViewRoot(11901): at android.view.ViewRoot.performTraversals(ViewRoot.java:1260)
E/ViewRoot(11901): at android.view.ViewRoot.handleMessage(ViewRoot.java:1873)
E/ViewRoot(11901): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRoot(11901): at android.os.Looper.loop(Looper.java:130)
E/ViewRoot(11901): at android.app.ActivityThread.main(ActivityThread.java:3703)
E/ViewRoot(11901): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRoot(11901): at java.lang.reflect.Method.invoke(Method.java:507)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller
.run(ZygoteInit.java:841)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/ViewRoot(11901): at dalvik.system.NativeStart.main(Native Method)
E/Surface(11901): Surface (identity=16462) requestBuffer(1, 0, 0, 0, 00000033)
returned a buffer with a null handle
E/Surface(11901): getBufferLocked(1, 0, 0, 0, 00000033) failed (Out of memory)
E/Surface(11901): dequeueBuffer failed (Out of memory)
E/ViewRoot(11901): OutOfResourcesException locking surface
E/ViewRoot(11901): android.view.Surface$OutOfResourcesException
E/ViewRoot(11901): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRoot(11901): at android.view.Surface.lockCanvas(Surface.java:314)
E/ViewRoot(11901): at android.view.ViewRoot.draw(ViewRoot.java:1467)
E/ViewRoot(11901): at android.view.ViewRoot.performTraversals(ViewRoot.java:1260)
E/ViewRoot(11901): at android.view.ViewRoot.handleMessage(ViewRoot.java:1873)
E/ViewRoot(11901): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRoot(11901): at android.os.Looper.loop(Looper.java:130)
E/ViewRoot(11901): at android.app.ActivityThread.main(ActivityThread.java:3703)
E/ViewRoot(11901): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRoot(11901): at java.lang.reflect.Method.invoke(Method.java:507)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller
.run(ZygoteInit.java:841)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/ViewRoot(11901): at dalvik.system.NativeStart.main(Native Method)
E/Surface(11901): Surface (identity=16463) requestBuffer(1, 0, 0, 0, 00000033)
returned a buffer with a null handle
E/Surface(11901): getBufferLocked(1, 0, 0, 0, 00000033) failed (Out of memory)
E/Surface(11901): dequeueBuffer failed (Out of memory)
E/ViewRoot(11901): OutOfResourcesException locking surface
E/ViewRoot(11901): android.view.Surface$OutOfResourcesException
E/ViewRoot(11901): at android.view.Surface.lockCanvasNative(Native Method)
E/ViewRoot(11901): at android.view.Surface.lockCanvas(Surface.java:314)
E/ViewRoot(11901): at android.view.ViewRoot.draw(ViewRoot.java:1467)
E/ViewRoot(11901): at android.view.ViewRoot.performTraversals(ViewRoot.java:1260)
E/ViewRoot(11901): at android.view.ViewRoot.handleMessage(ViewRoot.java:1873)
E/ViewRoot(11901): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ViewRoot(11901): at android.os.Looper.loop(Looper.java:130)
E/ViewRoot(11901): at android.app.ActivityThread.main(ActivityThread.java:3703)
E/ViewRoot(11901): at java.lang.reflect.Method.invokeNative(Native Method)
E/ViewRoot(11901): at java.lang.reflect.Method.invoke(Method.java:507)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller
.run(ZygoteInit.java:841)
E/ViewRoot(11901): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/ViewRoot(11901): at dalvik.system.NativeStart.main(Native Method)
ViewPagerFragment.java
package nsixty.crew.app;
import java.util.List;
import java.util.Vector;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.TitlePageIndicator;
import com.viewpagerindicator.TitleProvider;
public class ViewPagerFragment extends FragmentActivity {
private CustomFragmentAdapter mPagerAdapter;
ViewPager pager;
TitlePageIndicator titleIndicator;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.setContentView(R.layout.viewpager);
this.initialisePaging();
}
private void initialisePaging() {
List<Fragment> fragments = new Vector<Fragment>();
fragments
.add(Fragment.instantiate(this, LoginActivity.class.getName()));
fragments.add(Fragment.instantiate(this, main.class.getName()));
this.mPagerAdapter = new CustomFragmentAdapter(
super.getSupportFragmentManager(), fragments);
pager = (ViewPager) findViewById(R.id.viewpager);
pager.setAdapter(this.mPagerAdapter);
// titleIndicator = (TitlePageIndicator) findViewById(R.id.);
// titleIndicator.setViewPager(pager);
}
public static class CustomFragmentAdapter extends FragmentPagerAdapter
implements TitleProvider {
public static final int POSITION_PAGE_1 = 0;
public static final int POSITION_PAGE_2 = 1;
public static final int POSITION_PAGE_3 = 2;
private List<Fragment> fragments;
private static final String[] TITLES = new String[] { "LOGIN", "HOME" };
public static final int NUM_TITLES = TITLES.length;
@Override
public String getTitle(int position) {
return TITLES[position];
}
public CustomFragmentAdapter(FragmentManager fm,
List<Fragment> fragments) {
super(fm);
this.fragments = fragments;
}
@Override
public int getCount() {
// return this.fragments.size();
return NUM_TITLES;
}
@Override
public Fragment getItem(int position) {
try {
LoginActivity.class.newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return this.fragments.get(position);
}
}
}
类似问题
帮助,我需要帮助不知道这些是什么错误我已经研究过,我没有看到任何合理的答案......这很奇怪,我不知道这些是什么错误。我只是在做一个只有两张幻灯片的简单视图寻呼机。