Why onSurfaceTextureAvailable cannot continue on Android 4.4? -


i remove textureview root layout , add windowmanager,

        mviewwidth = mtextureview.getwidth();         mviewheight = mtextureview.getheight();         rootview.removeview(mtextureview);          windowmanager mwm = (windowmanager)getapplicationcontext().getsystemservice(context.window_service);         windowmanager.layoutparams lp = new windowmanager.layoutparams(windowmanager.layoutparams.type_system_error);         lp.width = windowmanager.layoutparams.wrap_content;         lp.height = windowmanager.layoutparams.wrap_content; //        lp.width = windowmanager.layoutparams.match_parent; //        lp.height = windowmanager.layoutparams.match_parent;         lp.flags = windowmanager.layoutparams.flag_not_focusable;// |windowmanager.layoutparams.flag_not_touch_modal;//|         lp.format = pixelformat.translucent; //pixelformat.rgba_8888; //         lp.gravity = gravity.bottom | gravity.right;         mwm.addview(mtextureview, lp); 

on android 4.4, textureview cannot display in windowmanager, output log:

11-06 00:55:19.316 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onresume 11-06 00:55:19.326 24147-24147/com.example.victors.myapplication d/dalvikvm: gc_for_alloc freed 216k, 8% free 3609k/3900k, paused 2ms, total 2ms                                                                               [ 11-06 00:55:19.326 24147:24156 d/         ]                                                                              hostconnection::get() new host connection established 0xb89048b0, tid 24156 11-06 00:55:19.386 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureavailable, surface: android.graphics.surfacetexture@9d0bf130 11-06 00:55:19.396 24147-24147/com.example.victors.myapplication w/mediaplayer: setscreenonwhileplaying(true) ineffective without surfaceholder 11-06 00:55:19.426 24147-24147/com.example.victors.myapplication e/mediaplayer: should have subtitle controller set 11-06 00:55:19.636 24147-24163/com.example.victors.myapplication w/mediaplayer: info/warning (3, 0) 11-06 00:55:19.656 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:19.856 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:19.916 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:19.966 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.016 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.036 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.106 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.156 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.186 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.236 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.256 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.316 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.406 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.426 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.506 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.516 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.586 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.636 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.706 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:20.756 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:21.036 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:21.306 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:21.486 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:21.516 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,343) 11-06 00:55:21.656 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:21.736 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:21.906 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:22.006 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 00:55:22.216 24147-24147/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetexturedestroyed 11-06 00:55:22.226 24147-24147/com.example.victors.myapplication w/textureview: textureview or subclass can used hardware acceleration enabled. 11-06 00:55:22.526 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,402) 11-06 00:55:23.556 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,361) 11-06 00:55:24.566 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,353) 11-06 00:55:25.566 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,378) 11-06 00:55:29.636 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,307) 11-06 00:55:30.676 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,352) 11-06 00:55:31.686 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,392) 11-06 00:55:32.716 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,370) 11-06 00:55:34.786 24147-24147/com.example.victors.myapplication i/mediaplayer: info (700,654) 

but on android 6.0, textureview can display, output log:

11-06 13:04:44.732 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.766 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.799 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.832 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.866 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.901 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.933 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:44.966 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.000 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.033 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.060 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetexturedestroyed 11-06 13:04:45.127 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureavailable, surface: android.graphics.surfacetexture@50d5fbd 11-06 13:04:45.128 32280-32280/com.example.victors.myapplication w/mediaplayer: setscreenonwhileplaying(true) ineffective surface 11-06 13:04:45.152 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.189 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.217 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.251 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.285 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.319 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.352 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.385 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.419 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.452 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.487 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 11-06 13:04:45.519 32280-32280/com.example.victors.myapplication e/mediaplayeractivitywithtextureview: onsurfacetextureupdated 

why same code runs different result on android 4.4?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -