DialogFragment.show application freezes

I have a fragment that has a button. After clicking the button, the following code is executed:

@Override public void onClick(View clickedView) { switch(clickedView.getId()) { case R.id.btnTest: FragmentManager fm = getSherlockActivity().getSupportFragmentManager(); MyDialog dialog = new MyDialog(); dialog.show(fm, "TaskDeadlineDialog"); break; } } 

My piece of dialogue looks like this:

 public class MyDialog extends DialogFragment { public MyDialog() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedBundleInstance) { View currentView = inflater.inflate(R.layout.my_dialog_layout, parent); System.out.println("Inflated!"); return currentView; } } 

What happens, the dialog is not displayed, and the application stops responding. I am testing this on a Samsung SII with CMS ICS.

Edit: Logcat shows nothing.

 12-21 16:05:16.970: I/System.out(15753): debugger has settled (1304) 12-21 16:05:18.250: D/dalvikvm(15753): VFY: replacing opcode 0x6f at 0x0006 12-21 16:05:18.445: I/System.out(15753): Got ID: 1 12-21 16:05:20.430: I/System.out(15753): List position: 0 12-21 16:05:23.225: I/System.out(15753): Inflated! 12-21 16:05:38.510: D/dalvikvm(15753): GC_CONCURRENT freed 2265K, 41% free 4867K/8131K, paused 3ms+6ms 12-21 16:05:51.895: D/dalvikvm(15753): GC_CONCURRENT freed 1797K, 42% free 4787K/8131K, paused 2ms+2ms ..etc 

What am I doing wrong?

+4
source share
2 answers

It seems that the following widget, which I was fanning inside my dialog, was causing the problem: https://github.com/SimonVT/android-calendarview

I will tell the developer about this on the project problems page.

0
source

All I can think of is that for some reason you can block the flow of ui. I assume this is a fairly common error if you use synchronized operations or threads.

Look at your code again and follow the procedure step by step. Logcat should also display pending mailings longer until the application stops responding.

Change This answer may help you: fooobar.com/questions/1453804 / ...

+2
source

All Articles