Giter Club home page Giter Club logo

Comments (5)

1gravity avatar 1gravity commented on August 18, 2024

Please provide a stack trace. Ask the question as if this was stackoverflow...

from android-rteditor.

arthursz avatar arthursz commented on August 18, 2024

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.

arthursz avatar arthursz commented on August 18, 2024

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.

1gravity avatar 1gravity commented on August 18, 2024

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.

1gravity avatar 1gravity commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.