由于某些特定原因,我正在制作一个使用谷歌地图的应用程序.所以我在Android Studio中创建了一个Google Maps应用程序,我得到了一个扩展FragmentActivity的活动.一切都很完美,但现在我想在屏幕顶部添加操作栏.问题是地图占据了整个屏幕,我不知道如何修复它
这是我的活动代码:
public class MainActivity extends FragmentActivity implements LocationListener {
private GoogleMap mMap; // Might be null if Google Play services APK is not available.
double lon = 0;
double lat = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setUpMapIfNeeded();
}
@Override
protected void onResume() {
super.onResume();
setUpMapIfNeeded();
}
public void showSettingsAlert(){
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
// Setting Dialog Title
alertDialog.setTitle("GPS settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Do you want to go …Run Code Online (Sandbox Code Playgroud) android android-fragments android-actionbar android-fragmentactivity
我想创建一个能够从 uri 打开文本文件的应用程序。当时,我有这个代码:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.text_view_layout);
final Uri uri = getIntent() != null ? getIntent().getData() : null;
StringBuilder text = new StringBuilder();
InputStream inputStream = null;
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能让它读取整个文件?最好的问候,特拉贝菲