【发布时间】:2013-10-22 08:28:25
【问题描述】:
我正在开发一个图像过滤器应用程序,在这个应用程序中,我必须应用一些过滤器,如铅笔素描、裁剪等,因为我正在使用 android 的 aviary 库,但是当我调用 startActivityForResult() 应用程序时,我会强制关闭。以下是日志:
11-23 13:31:03.290: E/AndroidRuntime(4367): FATAL EXCEPTION: main11-23 13:31:03.290: E/AndroidRuntime(4367): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jai.imagedemo/com.aviary.android.feather.FeatherActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class android.widget.RelativeLayout
对解决这个问题有什么帮助吗? 这是我的代码:
Intent newIntent = new Intent( this, FeatherActivity.class );
newIntent.setData(Uri.parse(imageFilePath));
newIntent.putExtra( Constants.EXTRA_OUTPUT_FORMAT, Bitmap.CompressFormat.JPEG.name() );
String mSessionId = StringUtils.getSha256( System.currentTimeMillis() + "pv1frfq8o76siqy" );
newIntent.putExtra( Constants.EXTRA_OUTPUT_HIRES_SESSION_ID, mSessionId );
newIntent.putExtra( Constants.EXTRA_IN_SAVE_ON_NO_CHANGES, true );
startActivityForResult( newIntent, 2 );
这里是 Manifest 的内容(用于鸟类图书馆)
<activity
android:name="com.aviary.android.feather.FeatherActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:hardwareAccelerated="true"
android:largeHeap="true"
android:process=":standalone"
android:screenOrientation="unspecified" />
<provider
android:name="com.aviary.android.feather.library.providers.FeatherContentProvider"
android:authorities="com.aviary.launcher.HiResProvider"
android:exported="false" >
</provider>
【问题讨论】:
-
你解决了吗?刚刚遇到同样的错误...
-
@sirvon 我已经下载了这个示例 github.com/sephiroth74/Aviary-Android-Sample-App 并使用了这个示例中使用的 sdk,它可以工作
-
好的,谢谢。我会尝试...可能需要您的再次帮助。
-
你是否创建了aviary的api_key。 developers.aviary.com/docs/android/setup-guide#prerequisites 可能会有所帮助
-
刚刚遇到同样的错误。。有人解决了吗?