应用程序在启动时崩溃。试图只从官方中提取一段代码:zxing-sample
所以我的 activity_main.xml 代码来自示例,例如
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.design.widget.AppBarLayout
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/content_frame"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:orientation="horizontal"
android:gravity="center"
android:background="#222"
android:layout_width="match_parent"
android:layout_height="150dp">
<Button
android:text="Koristiti kameru"
android:layout_weight="1"
android:onClick="toggleFlash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
当年话下
狐的传说
相关分类