我有以下代码:
buttons[i].setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
try{
startActivity(new Intent(names[x][0]));
}
catch(ActivityNotFoundException e){
if (x==1) {
Intent intent = newIntent(Intent.ACTION_VIEW,Uri.parse("market://details?id=uk.co.nickfines.RealCalc"));
}
}
try {
startActivity(intent);
} catch (ActivityNotFoundException f) {
// Google Play Store app not available.
}
}
});
在我发表声明后它开始intent cannot be resolved to a variable
出错。在我这样做之前一切正常。问题是什么?startActivity(intent)
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=uk.co.nickfines.RealCalc")
if