Created
November 14, 2017 16:53
-
-
Save burhanrashid52/cada565831f28ef2f1687233257ef756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.arch.lifecycle.ViewModelProviders; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.TextView; | |
import com.burhan.arch.room.R; | |
public class RotationActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_rotation); | |
TextView txtRotation = findViewById(R.id.txtRotate); | |
MyViewModel myViewModel = ViewModelProviders.of(this).get(MyViewModel.class); | |
txtRotation.setText("Rotations : " + myViewModel.getRotationCount()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment