Android 预览显示Actionbar,但AVD不显示´;T
在预览中,Actionbar是可见的,但在AVD中不可见,我不知道为什么 如何使Actionbar在设备中也可见 我尝试了一些更改,比如删除Apptheme.NoActionBar…但不起作用 有什么想法吗?这是我的代码: 清单Android 预览显示Actionbar,但AVD不显示´;T,android,android-actionbar,themes,manifest,Android,Android Actionbar,Themes,Manifest,在预览中,Actionbar是可见的,但在AVD中不可见,我不知道为什么 如何使Actionbar在设备中也可见 我尝试了一些更改,比如删除Apptheme.NoActionBar…但不起作用 有什么想法吗?这是我的代码: 清单 activity.xml和activity.class <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://sc
activity.xml和activity.class
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_fahrzeug"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ibas.locatixteamviewer.FahrzeugActivity">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/fahrzeug_webView" />
</RelativeLayout>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fahrzeug);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
webView = (WebView) findViewById(R.id.fahrzeug_webView);
webView.getSettings().setJavaScriptEnabled(true); //Javascript erlauben bzw. aktivieren
webView.setWebViewClient(new WebViewClient()); //Diese Zeile, damit wir unsere App verwenden für die Webiste und nicht irgendein Browser geöffnet wird.
webView.loadUrl("Link..."); //?m=1&u=Gast&p=Gast
//webView.loadData("<html> <body> <h1> Hallo habibi </h1> <p> Das ist meine Testpage!!! </p> </body> </html>" , "text/html", "UTF-8"); //eigene Website anzeiogen durch HTML Code
webView.canGoBack();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_fahrzeug, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
//Handle item selection
switch (item.getItemId()) {
case R.id.map_tab:
Intent intent = new Intent(this, MapsActivity.class);
startActivity(intent);
return true;
case R.id.list_tab:
Intent intent2 = new Intent(this, ListActivity.class);
startActivity(intent2);
return true;
case R.id.web_tab:
Intent intent3 = new Intent(this, WebActivity.class);
startActivity(intent3);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@凌驾
创建时受保护的void(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fahrzeug);
Toolbar Toolbar=(Toolbar)findViewById(R.id.Toolbar);
设置支持操作栏(工具栏);
网络视图=(网络视图)findViewById(R.id.fahrzeug_网络视图);
webView.getSettings().setJavaScriptEnabled(true);//Javascript erlauben bzw.aktivieren
webView.setWebViewClient(new WebViewClient());//Diese Zeile,damit wir unsere App verwenden für die Webiste and nicht irgendein Browser geöffnet wird。
webView.loadUrl(“链接…”);/?m=1&u=Gast&p=Gast
//webView.loadData(“Hallo habibiDas ist meine Testpage!!!”、“text/html”、“UTF-8”);//eGene网站anzeiogen-durch html代码
webView.canGoBack();
}
@凌驾
公共布尔onCreateOptions菜单(菜单){
MenuInflater充气机=getMenuInflater();
充气机。充气(右菜单。菜单,菜单);
返回true;
}
@凌驾
公共布尔值onOptionsItemSelected(菜单项项){
//处理项目选择
开关(item.getItemId()){
案例R.id.map\u选项卡:
Intent Intent=新Intent(这是MapsActivity.class);
星触觉(意向);
返回true;
案例R.id.list_选项卡:
Intent intent2=新的Intent(这个,ListActivity.class);
星触觉(intent2);
返回true;
案例R.id.web\u选项卡:
Intent intent3=新的Intent(这个,WebActivity.class);
起始触觉(intent3);
返回true;
违约:
返回super.onOptionsItemSelected(项目);
}
}
我能做什么
多谢各位 请不要截图的代码。在问题中直接包含所有代码谢谢,请查看我的更新帖子。请不要截图。在问题中直接包含所有代码谢谢,请查看我的更新帖子。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_fahrzeug"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ibas.locatixteamviewer.FahrzeugActivity">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/fahrzeug_webView" />
</RelativeLayout>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fahrzeug);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
webView = (WebView) findViewById(R.id.fahrzeug_webView);
webView.getSettings().setJavaScriptEnabled(true); //Javascript erlauben bzw. aktivieren
webView.setWebViewClient(new WebViewClient()); //Diese Zeile, damit wir unsere App verwenden für die Webiste und nicht irgendein Browser geöffnet wird.
webView.loadUrl("Link..."); //?m=1&u=Gast&p=Gast
//webView.loadData("<html> <body> <h1> Hallo habibi </h1> <p> Das ist meine Testpage!!! </p> </body> </html>" , "text/html", "UTF-8"); //eigene Website anzeiogen durch HTML Code
webView.canGoBack();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_fahrzeug, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
//Handle item selection
switch (item.getItemId()) {
case R.id.map_tab:
Intent intent = new Intent(this, MapsActivity.class);
startActivity(intent);
return true;
case R.id.list_tab:
Intent intent2 = new Intent(this, ListActivity.class);
startActivity(intent2);
return true;
case R.id.web_tab:
Intent intent3 = new Intent(this, WebActivity.class);
startActivity(intent3);
return true;
default:
return super.onOptionsItemSelected(item);
}
}