I have a fragment which has a button. Once the button is clicked the following code executes:
@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 Dialog Fragment is as follows:
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 is, the dialog doesn’t show and the app stops responding. I am testing this on Samsung SII with CM9 ICS.
Edit: Logcat shows nothing either.
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?
Seems like the following widget which i was inflating inside my dialog was causing the issue:
https://github.com/SimonVT/android-calendarview
I’ll make sure i report this to the developer on the project’s issues page.