我正在创建一个简单的应用程序,在选项卡中使用谷歌地图,在其他地方使用其他东西.问题是当我改变方向时会重新创建地图,所以我转到latlng 0,0
这是我的代码
private static final String MAP_FRAGMENT_TAG = "map";
private static final String DUMMY_FRAGMENT_TAG = "DUMMY";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Set up the action bar to show tabs.
final ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
//
// // For each of the sections in the app, add a tab to the action bar.
actionBar.addTab(actionBar
.newTab()
.setText(R.string.title_section1)
.setTabListener(
new TabListener<SupportMapFragment>(this,
MAP_FRAGMENT_TAG, SupportMapFragment.class)));
actionBar
.addTab(actionBar
.newTab()
.setText(R.string.title_section2)
.setTabListener(
new TabListener<DummySectionFragment>(this,
DUMMY_FRAGMENT_TAG,
DummySectionFragment.class)));
}
Run Code Online (Sandbox Code Playgroud)
public class …Run Code Online (Sandbox Code Playgroud) 我需要帮助将颜色从下一个字符串资源显示到文本视图
<string name="colored">
<b>Something working perfectly</b>
<font color="#F38">Something that doesn't work</font>
</string>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/colored"
/>
Run Code Online (Sandbox Code Playgroud)