1
我在網上找到了以下代碼。我對第一行感到困惑。這條線的目的是什麼?「@SuppressWarnings(」unchecked「)」的用途是什麼?
@SuppressWarnings("unchecked")
private void showAlert(String title,String msg,final Class cls)
{
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle(title);
alertDialog.setMessage(msg);
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent samepage = new Intent(LoginActivity.this,
cls);
startActivity(samepage);
}
});
alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
}