android - Soundpool music does not play and Dialog disappears on pressing Positive button -


in below code facing 2 problems.

  1. soundpool not play when dialog appears when alarm fires. while dialog visible , press "recent apps" button , can find dialog shown app in list , when click on that, sound plays , dialog appears. still there error messages captured in log**. i'm not able understand log message. have included log message. please me in understanding log.

  2. i trying run countdown timer in dialog box. when press "start" button want display counter in textview. when click "start" button, dialog disappears. how make dialog visible when start button pressed?

    public class notifier extends activity { soundpool sp = null; int explosion = 0; sharedpreferences storedata; public static final string filename = "hydrate_quantity_data"; float latest_quantity;  alertdialog alertdialog;  public void returnvaluefromsharedpreferences() {  storedata = getsharedpreferences(filename, 0); latest_quantity = storedata.getfloat("latest_quantity", 0);  }  @override protected void oncreate(bundle savedinstancestate) {     // todo auto-generated method stub // settheme(android.r.style.theme_dialog); super.oncreate(savedinstancestate); sp = new soundpool(5, audiomanager.stream_music, 0); explosion = sp.load(this, r.raw.hydrate, 1);             alertdialog.builder alertdialogbuilder =                                   new alertdialog.builder(this); final textview edittext = new textview(this); edittext.settext("press 'start' begin countdown"); alertdialogbuilder.settitle("its time"); alertdialogbuilder.setmessage("for 20 seconds"); alertdialogbuilder.setview(edittext); alertdialogbuilder.setcancelable(false);  alertdialogbuilder.setpositivebutton("start", new dialoginterface.onclicklistener() {     public void onclick(dialoginterface dialog, int whichbutton) {         // ever want value             new countdowntimer(20000, 1000) {                 @override                 public void ontick(long millisuntilfinished) {                      edittext.settext("00:"+ (millisuntilfinished/1000));                  }                  @override                 public void onfinish() {                     // todo auto-generated method stub                  }               }.start();       } });  alertdialogbuilder.setnegativebutton("close", new dialoginterface.onclicklistener() {     public void onclick(dialoginterface dialog, int whichbutton) {          alertdialog.cancel();     } });  alertdialog = alertdialogbuilder.create(); alertdialog.show();   @override protected void onstart() { // todo auto-generated method stub     super.onstart();     if (explosion != 0) {         sp.play(explosion, 1, 1, 0, 0, 1);     }     returnvaluefromsharedpreferences(); }    } 

the log:

09-02 00:20:32.390: w/system(17954): classloader referenced unknown path: /data/app/com.akdev.healthify-2/lib/arm64 09-02 00:20:32.392: v/monotype(17954): setapptypeface- try flip, app = com.akdev.healthify 09-02 00:20:32.396: v/monotype(17954):
typeface getfontpathflipfont - systemfont = default#default 09-02 00:20:32.407: v/monotype(17954): setapptypeface- try flip, app = com.akdev.healthify 09-02 00:20:32.407: v/monotype(17954):
typeface getfontpathflipfont - systemfont = default#default 09-02 00:20:32.488: v/boostframework(17954): macquirefunc method = public int com.qualcomm.qti.performance.perflockacquire(int,int[]) 09-02 00:20:32.488: v/boostframework(17954): mreleasefunc method = public int com.qualcomm.qti.performance.perflockrelease() 09-02 00:20:32.488: v/boostframework(17954): macquiretouchfunc method = public int com.qualcomm.qti.performance.perflockacquiretouch(android.view.motionevent,android.util.displaymetrics,int,int[]) 09-02 00:20:32.488: v/boostframework(17954): miopstart method = public int com.qualcomm.qti.performance.perfioprefetchstart(int,java.lang.string) 09-02 00:20:32.488: v/boostframework(17954): miopstop method = public int com.qualcomm.qti.performance.perfioprefetchstop() 09-02 00:20:32.530: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@b3a6454 09-02 00:20:32.531: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@f667ffd 09-02 00:20:32.757: d/openglrenderer(17954): use egl_swap_behavior_preserved: true 09-02 00:20:32.949: i/adreno-egl(17954): : egl 1.4 qualcomm build: nondeterministic_au_msm8916_64_la.br.1.2.6_rb1__release_au (ia10634f51b) 09-02 00:20:32.949: i/adreno-egl(17954): opengl es shader compiler version: xe031.06.00.05 09-02 00:20:32.949: i/adreno-egl(17954): build date: 01/04/16 mon 09-02 00:20:32.949: i/adreno-egl(17954): local branch: mybranch17585849 09-02 00:20:32.949: i/adreno-egl(17954): remote branch: quic/la.br.1.2.6_rb1.7 09-02 00:20:32.949: i/adreno-egl(17954): local patches: none 09-02 00:20:32.949: i/adreno-egl(17954): reconstruct branch: nothing 09-02 00:20:32.958: i/openglrenderer(17954): initialized egl, version 1.4 09-02 00:20:33.047: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@38d404e 09-02 00:20:33.049: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@710556f 09-02 00:20:33.050: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@ed6627c 09-02 00:20:33.051: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@b31e705 09-02 00:20:33.051: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@b81135a 09-02 00:20:34.200: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@66eee81 09-02 00:20:34.321: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@9e489d6 09-02 00:20:34.321: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@9d21457 09-02 00:20:34.325: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@df76d62 09-02 00:20:34.325: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@1799ef3 09-02 00:20:34.327: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@f62fdae 09-02 00:20:34.327: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@905374f 09-02 00:20:34.380: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@925fcc8 09-02 00:20:34.380: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@2e1c161 09-02 00:20:35.090: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@63ab79c 09-02 00:20:35.092: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@999e5a5 09-02 00:20:35.093: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@d1d3d7a 09-02 00:20:35.095: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@48a892b 09-02 00:20:35.096: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@709b188 09-02 00:20:35.444: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@a683721 09-02 00:20:36.100: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@3b1b746 09-02 00:20:36.207: v/monotype(17954): setapptypeface- try flip, app = com.akdev.healthify 09-02 00:20:36.207: v/monotype(17954):
typeface getfontpathflipfont - systemfont = default#default 09-02 00:20:36.211: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@ec201d2 09-02 00:20:36.211: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@f94f2a3 09-02 00:20:36.818: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@5ced132 09-02 00:20:37.999: w/inputeventreceiver(17954): attempted finish input event input event receiver has been disposed. 09-02 00:20:49.686: v/monotype(17954): setapptypeface- try flip, app = com.akdev.healthify 09-02 00:20:49.687: v/monotype(17954):
typeface getfontpathflipfont - systemfont = default#default 09-02 00:20:49.811: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@92d6130 09-02 00:20:49.811: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@70f31a9 09-02 00:20:49.831: w/soundpool(17954): sample 1 not ready 09-02 00:20:49.855: e/wvmextractor(17954): failed open libwvm.so: dlopen failed: library "libwvm.so" not found 09-02 00:20:49.901: v/qcomextractorfactory(17954): sniff start 09-02 00:20:49.901: v/qcomextractorfactory(17954): amount of data read @ start 1024 09-02 00:20:49.901: v/qcomextractorfactory(17954): parser_flags == 33ffff 09-02 00:20:49.901: v/qcomextractorfactory(17954): sniffogg ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 16 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 16 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffavi ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 6 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 5, formattocheck 6 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffac3 ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 1 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 1 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffasf ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 5 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 5 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffamrnb ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 3 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 3 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffamrwb ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 4 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 4 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffmkav ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 14 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 14 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniff3gp ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 10 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 10 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffqcp ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 17 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 17 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffflac ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 9 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 9 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffflv ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 23 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 23 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffmp2ts ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 13 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 13 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniff3g2 ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 11 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 11 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffmpeg2ps ===> 09-02 00:20:49.934: v/qcomextractorfactory(17954): updated ndataread value after format 12 check 1024 09-02 00:20:49.934: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 12 09-02 00:20:49.934: v/qcomextractorfactory(17954): sniffaac ===> 09-02 00:20:49.935: v/qcomextractorfactory(17954): return status after 1st call 1, size 8202 09-02 00:20:49.935: v/qcomextractorfactory(17954): didn't match sniff <=== status = 1, formattocheck 2 09-02 00:20:49.935: v/qcomextractorfactory(17954): sniffmp3 ===> 09-02 00:20:49.935: v/qcomextractorfactory(17954): return status after 1st call 0, size 8202 09-02 00:20:49.935: v/qcomextractorfactory(17954): sniffmp3 success<=== 09-02 00:20:49.935: i/qcomextractorfactory(17954): sniff: set key use qti parser 09-02 00:20:49.942: i/extendedextractor(17954): qtiparser prefered 09-02 00:20:49.943: v/qcomextractorfactory(17954): instantiate mmparserextractor 09-02 00:20:49.943: i/extendedextractor(17954): extendedextractor::create 0x556c0a0cd0 09-02 00:20:49.943: i/extendedextractor(17954): extendedextractor::updateextractor: use default qti parser 09-02 00:20:49.943: e/mm_osal(17954): filesource::filesource 09-02 00:20:49.943: e/mm_osal(17954): filesource::filesource m_beverythingok 1 09-02 00:20:49.943: e/mm_osal(17954): mm_file_create failed .efs error no -1 , file name /data/mmosal_logmask.cfg , mode 0 09-02 00:20:49.943: e/mm_osal(17954): open or read fail on /data/mmosal_logmask.cfg. possible permission denied issue. looking /data/misc/media/mmosal_logmask.cfg 09-02 00:20:49.943: e/mm_osal(17954): mm_file_create failed .efs error no -1 , file name /data/misc/media/mmosal_logmask.cfg , mode 0 09-02 00:20:49.968: i/omxclient(17954): using client-side omx mux. 09-02 00:20:50.255: e/mmparserextractor(17954): filesource::file_source_data_end 09-02 00:20:51.701: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@29d86a7 09-02 00:20:54.078: v/boostframework(17954): boostframework() : mperf = com.qualcomm.qti.performance@e57dabb 09-02 00:20:54.270: w/iinputconnectionwrapper(17954): beginbatchedit on inactive inputconnection 09-02 00:20:54.270: w/iinputconnectionwrapper(17954): endbatchedit on inactive inputconnection 09-02 00:20:54.307: v/renderscript(17954): 0x556c0bf080 launching thread(s), cpus 4 09-02 00:20:54.315: w/iinputconnectionwrapper(17954): beginbatchedit on inactive inputconnection 09-02 00:20:54.316: w/iinputconnectionwrapper(17954): endbatchedit on inactive inputconnection


Comments