title: Android Studio error when running java class
body: <p>Hi I have tried to run my program however I am getting an error in one of my Java file, however I don't understand the error as the code works perfectly in eclipse, however it bring an error in Android Studio, please advise or help?,</p>
  
  <p>This is the error which I am currently getting, please advise?.</p>
  
  <pre><code>Error:(71, 14) error: no suitable method found for setText(Object)
  method TextView.setText(int,BufferType) is not applicable
  (actual and formal argument lists differ in length)
  method TextView.setText(int) is not applicable
  (actual argument Object cannot be converted to int by method invocation conversion)
  method TextView.setText(char[],int,int) is not applicable
  (actual and formal argument lists differ in length)
  method TextView.setText(CharSequence,BufferType) is not applicable
  (actual and formal argument lists differ in length)
  method TextView.setText(CharSequence) is not applicable
  (actual argument Object cannot be converted to CharSequence by method invocation conversion)
  </code></pre>
  
  <p>Please view the code below, where I am getting the error?</p>
  
  <pre><code> final TextView login = (TextView) findViewById(R.id.textwelcome);
          login.setText("Welcome  "+user.get("fname"));
  final TextView lname = (TextView) findViewById(R.id.lname);
          lname.setText(user.get("lname"));
  
  
          }}
  </code></pre>
  
  <p>Please view the full Java class code?</p>
  
  <pre><code>    public class Main extends Activity {
  ImageButton btnLogout;
  ImageButton changepas;
  
      /**
       * Called when the activity is first created.
       */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          changepas = (ImageButton) findViewById(R.id.btchangepass);
          btnLogout = (ImageButton) findViewById(R.id.logout);
          DatabaseHandler db = new DatabaseHandler(getApplicationContext());
  
          /**
           * Hashmap to load data from the Sqlite database
           **/
          HashMap user = new HashMap();
          user = db.getUserDetails();
  
          /**
           * Change Password Activity Started
           **/
          changepas.setOnClickListener(new View.OnClickListener(){
              public void onClick(View arg0){
  
                  Intent chgpass = new Intent(getApplicationContext(), ChangePassword.class);
  
                  startActivity(chgpass);
              }
  
          });
  
          /**
           *Logout from the User Panel which clears the data in Sqlite database
           **/
  
          btnLogout.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View arg0) {
  
                  UserFunctions logout = new UserFunctions();
                  logout.logoutUser(getApplicationContext());
                  Intent login = new Intent(getApplicationContext(), Login.class);
                  login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  startActivity(login);
                  finish();
         }
          });
      /**
       * Sets user first name and last name in text view.
       **/
      final TextView login = (TextView) findViewById(R.id.textwelcome);
              login.setText("Welcome  "+user.get("fname"));
      final TextView lname = (TextView) findViewById(R.id.lname);
              lname.setText(user.get("lname"));
       }}
  </code></pre>