Comments (5)
Please provide a stack trace. Ask the question as if this was stackoverflow...
from android-rteditor.
Sorry and thanks for the help, your editor is the best. Here is the stack trace:
E/AndroidRuntime: FATAL EXCEPTION: main
E/AndroidRuntime: Process: com.ufcspa.unasus.appportfolio, PID: 28388
E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ufcspa.unasus.appportfolio/com.ufcspa.unasus.appportfolio.Activities.MainActivity}: java.lang.IllegalStateException: The RTMediaFactory is null. Please make sure to register the editor at the RTManager before using it.
E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2376)
E/AndroidRuntime: at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3928)
E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:147)
E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5253)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
E/AndroidRuntime: Caused by: java.lang.IllegalStateException: The RTMediaFactory is null. Please make sure to register the editor at the RTManager before using it.
E/AndroidRuntime: at com.onegravity.rteditor.RTEditText.assertRegistration(RTEditText.java:403)
E/AndroidRuntime: at com.onegravity.rteditor.RTEditText.setRichTextEditing(RTEditText.java:315)
E/AndroidRuntime: at com.onegravity.rteditor.RTEditText.onRestoreInstanceState(RTEditText.java:535)
E/AndroidRuntime: at android.view.View.dispatchRestoreInstanceState(View.java:13629)
E/AndroidRuntime: at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2893)
E/AndroidRuntime: at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2893)
E/AndroidRuntime: at android.view.View.restoreHierarchyState(View.java:13607)
E/AndroidRuntime: at android.support.v4.app.Fragment.restoreViewState(Fragment.java:468)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1094)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1230)
E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2042)
E/AndroidRuntime: at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:165)
E/AndroidRuntime: at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:543)
E/AndroidRuntime: at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
E/AndroidRuntime: at android.app.Activity.performStart(Activity.java:5991)
E/AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2279)
E/AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2376)
E/AndroidRuntime: at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3928)
E/AndroidRuntime: at android.app.ActivityThread.access$900(ActivityThread.java:147)
E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5253)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
from android-rteditor.
The first problem was resolved =D
We put the editor registration inside onViewCreated, like this:
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// register editor & set text
rtEditText = (RTEditText) getView().findViewById(R.id.rtEditText);
rtManager.registerEditor(rtEditText, true);
}
But pick image and take picture still doesn't work.
from android-rteditor.
I extended the demo app to show an Activity and a Fragment based implementation: 54a2efc.
The image issue is due to you not calling through to RTManager.onActivityResult.
When picking an image that happens in a separate Activity which reports back a reference to the image to the rich text editor. Check out the new RTEditorActivityWithFragment to see what is needed in onActivityResult. I'm considering using EventBus to replace that communication and to make the onActivityResult "hack" obsolete.
from android-rteditor.
I actually just replaced the tedious Intent/onActivityResult mechanism by a simple EventBus post: 92edc7b. I publishing a new version sometimes today.
Oh and next time create separate issues for each problem please.
from android-rteditor.
Related Issues (20)
- Trouble Applying the 1.6.7 version HOT 3
- How to add a blockquote an horizontal line?
- Photo Capture is not working in the latest version of this library (1.6.7 of RTEditor)
- Android 8.0 insert text crash
- Fatal Exception: java.lang.IllegalStateException: The RTMediaFactory is null. Please make sure to register the editor at the RTManager before using it. HOT 2
- Can we have support for Fonts? HOT 1
- android.view.InflateException while using RTEditor HOT 1
- No subscribers registered for event class com.onegravity.rteditor.media.choose.MediaEvent when picking an image
- 为啥如此设置字体恢复不了 HOT 2
- Installation Error HOT 5
- link error
- Heading1 and heading2 formatting required HOT 2
- is this support kotlin? HOT 1
- [BUG] numbering append with <ol> when the last item deleted HOT 2
- It is possible to add emoji and file uploading
- Insta bug 11.3.0 is not working after integrated rteditor:1.7.6" HOT 2
- [BUG] Indentation left does not work any more in latest version
- [BUG] Caused by: android.view.InflateException: Binary XML file line #36 HOT 1
- 向右一直缩进到最后不会变成竖直一列
- problem when using proguard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-rteditor.