2012-08-29 2 views

답변

0

Activity을 시작할 때 System.currentTimeMillis()을 호출하고 변수에 저장하십시오. 어디서 원하는지 , Activity 및 기타 내부 요소가 "부풀려 지거나"인스턴스화되거나 onResume() 인 경우 Activity이 화면에 나타납니다.

예 :

public void onCreate(Bundle savedInstanceState) { 
    long timeOpened = System.currentTimeMillis(); 
} 
0

긴 lDateTime = 새로운 날짜() 다음 getTime(). Oncreate의 mainActivity에서이 코드를 사용할 수 있습니다. MainActivity가이 코드를 호출하고 밀리 초 단위로 시간을 얻을 때

또는 long time = System.currentTimeMillis(); 이것은 또한 현재 시간 (밀리 세)