Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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