-1
android.view.InflateException: Binary XML file line #3: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:626)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
at android.view.LayoutInflater.inflate(LayoutInflater.java:470)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at com.fiberCinema.categories$MovieAdapter.getView(categories.java:193)
at android.widget.AbsListView.obtainView(AbsListView.java:2742)
at android.widget.ListView.makeAndAddView(ListView.java:1811)
at android.widget.ListView.fillDown(ListView.java:697)
at android.widget.ListView.fillFromTop(ListView.java:763)
at android.widget.ListView.layoutChildren(ListView.java:1627)
at android.widget.AbsListView.onLayout(AbsListView.java:2567)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1766)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1389)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:868)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:15640)
at android.view.ViewGroup.layout(ViewGroup.java:4884)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2379)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2087)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1263)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6611)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:812)
at android.view.Choreographer.doCallbacks(Choreographer.java:612)
at android.view.Choreographer.doFrame(Choreographer.java:582)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:798)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper...
public class MainActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
MultiDex.install(getApplication());
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowHomeEnabled(true);
viewPager = (ViewPager) findViewById(R.id.viewpager);
setupViewPager(viewPager);
final String[] from = new String[] {"name"};
final int[] to = new int[] {android.R.id.text1};
myAdapter = new SimpleCursorAdapter(MainActivity.this, android.R.layout.simple_spinner_dropdown_item, null, from, to, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER);
new AsyncFetch().execute();
tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
setupTabIcons();
}
private void setupTabIcons() {
tabLayout.getTabAt(0).setIcon(tabIcons[0]);
tabLayout.getTabAt(1).setIcon(tabIcons[1]);
tabLayout.getTabAt(2).setIcon(tabIcons[2]);
//tabLayout.getTabAt(3).setIcon(tabIcons[3]);
}
private void setupViewPager(ViewPager viewPager) {
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
adapter.addFragment(new home(),getString(R.string.title_home));
adapter.addFragment(new featured(), getString(R.string.featured));
adapter.addFragment(new categories(),getString(R.string.categories));
viewPager.setAdapter(adapter);
}
public class featured extends Fragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.featured,null);
Bundle args = getArguments();
if (args != null) {
lvMovies = (ListView) v.findViewById(R.id.lvMovies);
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getActivity().getApplicationContext())
.defaultDisplayImageOptions(defaultOptions)
.build();
ImageLoader.getInstance().init(config);
bindGridView();
}
return v;
}
ありがとうございます、21 APIバージョンをサポートする方法はありますか? –
分かりません。私はAndroidでかなり新しいです、ごめんなさい。私たちの両方がそれを学ぶように別の答えを待ちます。 – Kanayel