我希望我的微调器位于工具栏(菜单左侧)的菜单旁边,但是当前微调器显示在菜单下方.我是否必须以某种方式添加它onCreateOptionsMenu(Menu menu)
我的活动:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
Spinner spinner = (Spinner) findViewById(R.id.travelType_spinner);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.travelType_array, R.layout.spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
if (spinner != null) {
spinner.setAdapter(adapter);
}
Run Code Online (Sandbox Code Playgroud)
布局:
<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" …Run Code Online (Sandbox Code Playgroud) 试图更新我的firebaseui.但为什么这不能在我的gradle文件中工作?
compile 'com.firebaseui:firebase-ui:0.4.0'
Run Code Online (Sandbox Code Playgroud)
更新 仍然是同样的问题.
我的其他依赖项也更新了:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.1'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.maps:google-maps-services:0.1.12'
compile 'com.google.maps.android:android-maps-utils:0.4.3'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.firebase:firebase-simple-login:1.4.2'
compile "com.google.firebase:firebase-database:9.0.0"
compile 'com.firebaseui:firebase-ui:0.4.0'
Run Code Online (Sandbox Code Playgroud) 如何将push()添加到航点儿童?无法做到正确..
Map mWaypoints = new HashMap();
mWaypoints.put("latitude", mCurrentLatlngOnCreate.latitude);
mWaypoints.put("longitude", mCurrentLatlngOnCreate.longitude);
Map mParent = new HashMap();
mParent.put("routeID", "my route id");
mParent.put("routeName", "my route name");
mParent.put("Waypoints", mWaypoints);
myFirebaseRef.push().setValue(mParent);
Run Code Online (Sandbox Code Playgroud)
这是当前结果,但希望将推送ID设置在Waypoints之下.
-KGNWnjgXPC0kHYiOKG7
Waypoints // <--- Want to get the unique below here
latitude: 31
longitude: 421
routeID: "my route id"
routeName: "my route name"
Run Code Online (Sandbox Code Playgroud)