Today encountered a wonderful problem, an app's big frame is the following four tab page, so I used the tabactivity, of which two tab pages are sweep sweep and Baidu map activity. The problem comes, if you click the tab page into the camera, the scan is normal, but then click on the map, the entire map will not show. On the contrary, advanced to Baidu Map, and then into the camera, is the same problem, only the map is covered on the above, the camera preview in the following show does not come out.
Examples are as follows:
After my home analysis, the reason that the camera used Surfaceview as a preview vector, Surfaceview has the feature of Preemption window, he is not a view in essence. So it can be speculated that Baidu map Mapview is similar to a thing, when two live in a tabactivity, switching to each other will lead to the above problems. There are 2 ways to solve this problem:
1, is the camera preview carrier transposition Texttureview, should be OK!
2, do not put the camera and Baidu map in a tab, let one of the direct start by tabactivity. At this time into the scan, and tabactivity relationship, Baidu Map How to switch also do not affect.
The relevant code is as follows:
Case R.id.radiobtn_2:
Gotomipcaactivitycapture ();
Radiobtn_2.setchecked (FALSE);
This.mHost.setCurrentTabByTag (TAB2);
Break
In addition, because the click Scan, tag is not set down, to add a tag according to the host to update the function of the tags icon, in the Onresume call:
private void Updatetabiconbytag () {
String Currtag = Mhost.getcurrenttabtag ();
if (Currtag.equals (TAB1)) {
Radiobtn_1.setchecked (TRUE);
}else if (currtag.equals (TAB3)) {
Radiobtn_3.setchecked (TRUE);
}else if (currtag.equals (TAB4)) {
Radiobtn_4.setchecked (TRUE);
}
}
Hurry up and write so much.
Camera and Baidu map in Tabactivity, switching to each other leading to the display of disorder problem solving