Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 点击按钮导致崩溃_Java_Android_Debugging_Crash_Pdf Generation - Fatal编程技术网

Java 点击按钮导致崩溃

Java 点击按钮导致崩溃,java,android,debugging,crash,pdf-generation,Java,Android,Debugging,Crash,Pdf Generation,我克隆了一个应用程序,它允许您捕获或选择图像并将其保存在pdf文档中 它工作得很好,但当我试图集成到我的应用程序模块(新项目)中并单击按钮启动活动时,它崩溃了。我没有改变任何事Logcat也帮不上忙 有什么想法吗 注意:我已经在清单中添加了活动 编辑:我在下面添加了样式和布局 风格 <style name="MyAppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary

我克隆了一个应用程序,它允许您捕获或选择图像并将其保存在pdf文档中

它工作得很好,但当我试图集成到我的应用程序模块(新项目)中并单击按钮启动活动时,它崩溃了。我没有改变任何事Logcat也帮不上忙

有什么想法吗

注意:我已经在清单中添加了活动

编辑:我在下面添加了样式和布局

风格

<style name="MyAppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>
此活动已具有由window decor提供的操作栏。 不要请求Window.FEATURE\u SUPPORT\u ACTION\u栏并设置 windowActionBar在主题中设置为false,以改为使用工具栏。 在androidx.appcompat.app.appcompatedelegateimpl.setSupportActionBar上(appcompatedelegateimpl.java:421)

需要另一个主题。首先,转到舱单

<activity android:name=".ImagePickerActivity"
            android:theme="@style/CustomTheme"
            android:screenOrientation="portrait"
            />

然后转到res/values/styles.xml部分。创建主题。你的主题是

<style name="CustomTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

@颜色/原色
@颜色/原色暗
@颜色/颜色重音
假的
真的
此活动已具有由window decor提供的操作栏。 不要请求Window.FEATURE\u SUPPORT\u ACTION\u栏并设置 windowActionBar在主题中设置为false,以改为使用工具栏。 在androidx.appcompat.app.appcompatedelegateimpl.setSupportActionBar上(appcompatedelegateimpl.java:421)

需要另一个主题。首先,转到舱单

<activity android:name=".ImagePickerActivity"
            android:theme="@style/CustomTheme"
            android:screenOrientation="portrait"
            />

然后转到res/values/styles.xml部分。创建主题。你的主题是

<style name="CustomTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

@颜色/原色
@颜色/原色暗
@颜色/颜色重音
假的
真的

已修复。感谢@intellij amiya

我错过了另一种风格。我在用

<activity android:name="com.nabeeltech.capturedoc.imgtopdf.PdfActivity"
            android:label="@string/title_activity_pdf"
            android:theme="@style/MyAppTheme"/>

        <activity android:name="com.gun0912.tedpicker.ImagePickerActivity"
            android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
            android:screenOrientation="portrait"
            />

现在它可以工作了。

修复了。感谢@intellij amiya

我错过了另一种风格。我在用

<activity android:name="com.nabeeltech.capturedoc.imgtopdf.PdfActivity"
            android:label="@string/title_activity_pdf"
            android:theme="@style/MyAppTheme"/>

        <activity android:name="com.gun0912.tedpicker.ImagePickerActivity"
            android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
            android:screenOrientation="portrait"
            />

现在它可以工作了。

@IshakBenaissa显示你的
style.xml
请。@IshakBenaissa一步一步读我的答案。检查你的舱单。您应该为XML中的imageview添加主题
ImagePickerActivity
请帮助我为您的活动中没有imageview添加
android:adjustViewBounds=“true”android:scaleType=“fitXY”
_pdf@IshakBenaissa请出示你的
style.xml
。@IshakBenaissa一步一步读我的答案。检查你的舱单。您应该为XML中的imageview添加主题
ImagePickerActivity
请帮助我@IshakBenaissa添加
android:adjustViewBounds=“true”android:scaleType=“fitXY”
如果您的活动中没有imageview,请检查我的答案。@IntelliJAmiya感谢您的工作,但是我在git上发布了另一个关于显示的图像大小的问题,请检查我的答案。@IntelliJAmiya感谢这项工作,但我在git上发布了另一个关于显示的图像大小的问题
android:theme="@style/AppTheme_picker"