I use Bundle approach from this link:https://stackoverflow.com/a/21102881/2641960
but i faced with this error:
-15 11:14:47.323 8558-8558/co.kssg.expertnote E/InputEventReceiver﹕ Exception dispatching input event.
04-15 11:14:47.323 8558-8558/co.kssg.expertnote E/MessageQueue-JNI﹕ Exception in MessageQueue callback: handleReceiveCallback
04-15 11:14:47.333 8558-8558/co.kssg.expertnote E/MessageQueue-JNI﹕ java.lang.IllegalStateException: Activity has been destroyed
Here is my Method to Send Bundle Data To Fragment:
public void sendDataToFragment (String data)
{
Bundle bundle = new Bundle();
MainActivity ac = new MainActivity();
FragmentManager fManager = ac.getFragmentManager();
FragmentTransaction transaction = fManager.beginTransaction();
bundle.putString("message", data );
DataFragment dataFragment = new DataFragment();
dataFragment.setArguments(bundle);
transaction.replace(R.id.sFLayout, dataFragment);
transaction.commit();
}
this method is placed in a custom ImageView Class.
Thanks for help.