class xxx extends Fragment implements OnItemClickListener
【情境1】切換activity
Intent intent = new Intent(this, ooo.class);←false
Intent intent = new Intent(getActivity(), ooo.class);←true
【情境2】show dialog
↓false
new AlertDialog.Builder(this).setTitle("")
.setMessage(R.string.nonetworkalert)
.setCancelable(false)
.setPositiveButton(R.string.sure,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialoginterface, int i)
{
}
}
).show();
↓true
new AlertDialog.Builder(getActivity()).setTitle("")
.setMessage(R.string.nonetworkalert)
.setCancelable(false)
.setPositiveButton(R.string.sure,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialoginterface, int i)
{
}
}
).show();
沒有留言:
張貼留言