2012-07-15 2 views
0
안드로이드

에서 시계 알람 내가어떻게

java.lang.SecurityException: Permission Denial: opening provider 
com.android.deskclock.AlarmProvider from ProcessRecord{4162b268 
12999:com.genie9.gcloudbackup/10059} (pid=12999, uid=10059) that is not exported from uid 10011 

가하는 다음과 같은 예외를 받고

Uri uri = Uri.parse("content://com.android.deskclock/AlarmClock"); 
     Cursor c = mContext.getContentResolver().query(uri, null, null, null,null); 
     if (c != null) { 
      String names[] = c.getColumnNames(); 
      for (String temp : names) { 
       System.out.println(temp); 

      } 

      if (c.moveToFirst()) { 
       do { 
        int i = 0; 
        for (int j = 0; j < c.getColumnCount(); j++) { 
        } 
       } while (c.moveToNext()); 
      } 
     } 

스피 다음 코드를 사용하여 모바일 스피에서 시계 응용 프로그램의 알람을 얻고 싶은 얻을 수 있습니다 어떤 사람이 내가 여기서 사용해야하는 허가가 무엇인지 압니까? 난 당신이 알람 클래스 see here

를 사용하여 알람을 설정할 수 있습니다 또는 당신은이 URI에 액세스 할 수 없습니다

+1

안녕 아래에 주어진 매니페스트에 권한을 추가해야 할 것이다, 알람 시계, 알람을 설정하는 코드 아래 사용할 수 있습니다 해결책? –

답변

0

을 돕는 유용한, 덕분에 많이 검색 한 아무것도 찾을 수 없습니다. 하지만 당신은

Intent i = new Intent(AlarmClock.ACTION_SET_ALARM); 
    i.putExtra(AlarmClock.EXTRA_HOUR, 9); 
    i.putExtra(AlarmClock.EXTRA_MINUTES, 37); 
    startActivity(i); 

당신은, 당신이 하나를 발견 같은 issue.Have에 직면하고있다

<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> 
+1

아니요 의도를 사용하고 알람 시계 응용 프로그램을 사용하고 싶지 않습니다. 장치에 설정된 모든 알람을 읽으려고합니다.이 작업을 수행 할 방법이 있습니까? – AnasBakez

+1

아니, 그럴 수 없어 !! – AAnkit