package com.example.nemophila; import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.example.nemophila.FriendActivity; import com.example.nemophila.MainActivity; import com.example.nemophila.MyPageEditorActivity; import com.example.nemophila.R; import com.example.nemophila.RequestedActivity; import com.example.nemophila.entities.Account; import com.example.nemophila.viewmodels.AccountViewModel; public class MyPageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); Button friendButton = (Button) findViewById(R.id.friend); friendButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(MyPageActivity.this, FriendActivity.class); startActivity(intent); } }); Button changeMyPageButton = (Button) findViewById(R.id.changeMyPage); changeMyPageButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(MyPageActivity.this, MyPageEditorActivity.class); startActivity(intent); } }); Button cancelButton = (Button) findViewById(R.id.cancel); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(MyPageActivity.this, MainActivity.class); startActivity(intent); } }); Button RequestedButton = (Button) findViewById(R.id.requested); RequestedButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(MyPageActivity.this, RequestedActivity.class); startActivity(intent); } }); AccountViewModel accountViewModel = new ViewModelProvider(this).get(AccountViewModel.class); TextView name = (TextView) findViewById(R.id.name); TextView id = (TextView) findViewById(R.id.id); // accountViewModel.getAccountLiveData().observe(this, new Observer<Account>() { // // }); } }