mTextView01=(TextView) findViewById(R.id.myTextView01); //The method findViewById(int) in the type.
packagecom.example.helloworld;importandroid.os.Bundle;importandroid.app.Activity;impo...
package com.example.helloworld;
import android.os.Bundle;
import android.app.Activity;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView mTextView01;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView mTextView01 = (TextView) findViewById(R.id.myTextView01);
String str_2="Welcome to the java world. ";
mTextView01.setText(str_2);
}
}
The method findViewById(int) in the type Activity is not applicable for the arguments (Object) 展开
import android.os.Bundle;
import android.app.Activity;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView mTextView01;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView mTextView01 = (TextView) findViewById(R.id.myTextView01);
String str_2="Welcome to the java world. ";
mTextView01.setText(str_2);
}
}
The method findViewById(int) in the type Activity is not applicable for the arguments (Object) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询