Hello I am trying to code the time for Android development
import android.text.format.Time;
This is my code in the MainActivity
class within the protected void onCreate
.
TextView abc;
abc= (TextView) findViewById(R.id.clockTextView);
abc.setText("Time is " + Time.hour + ":" + Time.minute);
Why do I keep getting the error Cannnot make a static reference to the non-static field Time.hour
and how would I fix this? Thanks.