Hallo immer wenn ich meine App starte mit emulator kommt der dateifehler in der log cat:
ich weis da gar nicht was da jetzt der springende punkt ist was alles zum abstürzen bringt könnt ihr mir weiterhelfen?
03-18 14:39:29.396: D/skia(1337): --- allocation failed for scaled bitmap
03-18 14:39:29.426: D/AndroidRuntime(1337): Shutting down VM
03-18 14:39:29.426: W/dalvikvm(1337): threadid=1: thread exiting with uncaught exception (group=0xb1a63ba8)
03-18 14:39:29.646: D/dalvikvm(1337): GC_FOR_ALLOC freed 28911K, 45% free 36554K/65536K, paused 80ms, total 89ms
03-18 14:39:29.666: E/AndroidRuntime(1337): FATAL EXCEPTION: main
03-18 14:39:29.666: E/AndroidRuntime(1337): Process: com.schule.hakhas, PID: 1337
03-18 14:39:29.666: E/AndroidRuntime(1337): android.view.InflateException: Binary XML file line #332: Error inflating class <unknown>
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
03-18 14:39:29.666: E/AndroidRuntime(1337): at com.schule.hakhas.TestListView.onCreateView(TestListView.java:32)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.view.ViewPager.populate(ViewPager.java:1068)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.view.ViewPager.populate(ViewPager.java:914)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer.doFrame(Choreographer.java:544)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.os.Handler.handleCallback(Handler.java:733)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.os.Handler.dispatchMessage(Handler.java:95)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.os.Looper.loop(Looper.java:136)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Method.invokeNative(Native Method)
03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Method.invoke(Method.java:515)
03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-18 14:39:29.666: E/AndroidRuntime(1337): at dalvik.system.NativeStart.main(Native Method)
03-18 14:39:29.666: E/AndroidRuntime(1337): Caused by: java.lang.reflect.InvocationTargetException
03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Constructor.constructNative(Native Method)
03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
03-18 14:39:29.666: E/AndroidRuntime(1337): ... 47 more
03-18 14:39:29.666: E/AndroidRuntime(1337): Caused by: java.lang.OutOfMemoryError
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.drawable.Drawable.cr
Hier der Code der Main Activity:
mport java.util.Locale;
import android.app.ActionBar;import android.graphics.Color;import android.graphics.drawable.ColorDrawable;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 android.view.Menu;import android.view.MenuItem;
import android.view.View;
public class MainActivity extends FragmentActivity {
/** * The {@link android.support.v4.view.PagerAdapter} that will provide * fragments for each of the sections. We use a * {@link android.support.v4.app.FragmentPagerAdapter} derivative, which * will keep every loaded fragment in memory. If this becomes too memory * intensive, it may be best to switch to a * {@link android.support.v4.app.FragmentStatePagerAdapter}. */ SectionsPagerAdapter mSectionsPagerAdapter; /** * The {@link ViewPager} that will host the section contents. */ ViewPager mViewPager;
public Object ObjectFragment;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar ab = getActionBar(); ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#33b5e5")); ab.setBackgroundDrawable(colorDrawable);
// Create the adapter that will return a fragment for each of the three // primary sections of the app. mSectionsPagerAdapter = new SectionsPagerAdapter( getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setOffscreenPageLimit(4); } @Override public boolean onOptionsItemSelected(MenuItem item){ super.onOptionsItemSelected(item); switch(item.getItemId()){ case R.id.about: aboutMenuItem(); break; } return true; } private void aboutMenuItem(){ setContentView(R.layout.about); return; }
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; }
/** * A {@link FragmentPagerAdapter} that returns a fragment corresponding to * one of the sections/tabs/pages. */ public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) { super(fm); }
@Override public Fragment getItem(int position) {
Fragment fragment; switch (position) { case 0: fragment = new Fragment3(); break; case 1: fragment = new TestListView(); break; case 2: fragment = new Fragment1(); break; case 3: fragment = new Fragment4(); break; default: fragment = new Fragment1(); }
return fragment; }
@Override public int getCount() { // Show 3 total pages. return 4; }
@Override public CharSequence getPageTitle(int position) { Locale l = Locale.getDefault(); switch (position) { case 0: return getString(R.string.title_section4).toUpperCase(l); case 1: return getString(R.string.title_section1).toUpperCase(l); case 2: return getString(R.string.title_section2).toUpperCase(l); case 3: return getString(R.string.title_section3).toUpperCase(l); } return null; } }
/** * A dummy fragment representing a section of the app, but that simply * displays dummy text. */ public void button (View view) { setContentView(R.layout.activity_main); return; }}
Alles anzeigen
Und Hier der TestListView:
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;
public class TestListView extends Fragment {
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.tabitems, container, false);
return root;
}}
Alles anzeigen
und hier der tabitem.xml file:
<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:id="@+id/icon" android:layout_width="60dp" android:layout_height="60dp" android:layout_marginLeft="4dp" android:layout_marginRight="10dp" android:layout_marginTop="4dp" android:src="@drawable/marcel" />
<ImageView android:id="@+id/icon2" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon" android:layout_below="@+id/icon" android:src="@drawable/ploner" />
<TextView android:id="@+id/label2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon2" android:layout_marginTop="15dp" android:layout_toRightOf="@+id/icon" android:text="@string/christian" android:textSize="20sp" android:textColor="@color/entwickler"/>
<TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/label2" android:layout_alignTop="@+id/icon" android:layout_marginTop="17dp" android:text="@string/marcel" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon3" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon2" android:src="@drawable/chantal" />
<TextView android:id="@+id/label3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon3" android:layout_marginTop="17dp" android:layout_toRightOf="@+id/icon" android:text="@string/chantal" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon4" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon3" android:src="@drawable/taurer" />
<TextView android:id="@+id/label4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon4" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/melanie" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon5" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon4" android:src="@drawable/sarah" />
<TextView android:id="@+id/label5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon5" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/sarah" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon6" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon5" android:src="@drawable/nicola" />
<TextView android:id="@+id/label6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon6" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/nicola" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon7" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon6" android:src="@drawable/patricia" />
<TextView android:id="@+id/label7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon7" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/patricia" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon8" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon7" android:src="@drawable/katarina" />
<TextView android:id="@+id/label8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon8" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/katarina" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon9" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon8" android:src="@drawable/reiner" />
<TextView android:id="@+id/label9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon9" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/lukas" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon10" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon9" android:src="@drawable/karam" />
<TextView android:id="@+id/label10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon10" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/karam" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon11" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon10" android:src="@drawable/johannes" />
<TextView android:id="@+id/label11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon11" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/johannes" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon12" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon11" android:src="@drawable/christina" />
<TextView android:id="@+id/label12" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon12" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/christina" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon13" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon12" android:src="@drawable/maida" />
<TextView android:id="@+id/label13" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon13" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/maida" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon14" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon13" android:src="@drawable/carina" />
<TextView android:id="@+id/label14" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon14" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/carina" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon15" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon14" android:src="@drawable/rohrmooser" />
<TextView android:id="@+id/label15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon15" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/rohrmooser" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon16" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon15" android:src="@drawable/micheal" />
<TextView android:id="@+id/label16" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon16" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/michael" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon17" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon16" android:src="@drawable/david" />
<TextView android:id="@+id/label17" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon17" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/david" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon18" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon17" android:src="@drawable/sabrina" />
<TextView android:id="@+id/label18" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon18" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/sabrina" android:textSize="20sp" android:textColor="@color/entwickler"/> </RelativeLayout></ScrollView>
Alles anzeigen
Falls ihr noch irgendwas braucht einfach sagen !
Danke im vorraus