M Massimiliano Member Licensed User Longtime User Apr 17, 2017 #1 Hello, I need to read saved map data file inside the _onCreate hook (Main activity). Code: #if java public void _onCreate() { // I need here to get a map key .... } #end if Any hint? Massimiliano
Hello, I need to read saved map data file inside the _onCreate hook (Main activity). Code: #if java public void _onCreate() { // I need here to get a map key .... } #end if Any hint? Massimiliano
M Massimiliano Member Licensed User Longtime User Apr 18, 2017 #3 I'm trying to change theme at runtime as this old thread https://www.b4x.com/android/forum/threads/changing-the-theme-at-runtime.57277/ I've defined some custom styles inside my manifest public void _onCreate() { if (_theme_value != 0) setTheme(_theme_value); } However inside the main activity (firsttime load) I'm unable to get the StyleID stored inside the map file I've tried to declare theme_value anywere (inside main, globals and also in the starter service), but it seems that the onCreate is fired before I can assign a value to theme_value (map.get("styleID")). Rotating the main activity - so it reloads - the styleid it's applied correcly Also calling Code: Activity.Finish StartActivity(Me) when firstime=true only works on some devices on other devices activity finish but doesn't restart I've read @jonedon solution on post #14, but it'always return me StyleID 0. So probably I'm loosing something inside the java code Massimiliano Upvote 0
I'm trying to change theme at runtime as this old thread https://www.b4x.com/android/forum/threads/changing-the-theme-at-runtime.57277/ I've defined some custom styles inside my manifest public void _onCreate() { if (_theme_value != 0) setTheme(_theme_value); } However inside the main activity (firsttime load) I'm unable to get the StyleID stored inside the map file I've tried to declare theme_value anywere (inside main, globals and also in the starter service), but it seems that the onCreate is fired before I can assign a value to theme_value (map.get("styleID")). Rotating the main activity - so it reloads - the styleid it's applied correcly Also calling Code: Activity.Finish StartActivity(Me) when firstime=true only works on some devices on other devices activity finish but doesn't restart I've read @jonedon solution on post #14, but it'always return me StyleID 0. So probably I'm loosing something inside the java code Massimiliano
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2017 #4 Massimiliano said: when firstime=true only works on some devices on other devices activity finish but doesn't restart Click to expand... Use CallSubDelayed to call a sub that calls StartActivity(Me) (without finish). Upvote 0
Massimiliano said: when firstime=true only works on some devices on other devices activity finish but doesn't restart Click to expand... Use CallSubDelayed to call a sub that calls StartActivity(Me) (without finish).