Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drag/Drop feature in Android studio not working

I'm new to android programming The drag/ and drop feature in android studio is not working. I can't drag anything to my phone. Right now my fragment is google map view and i want to add a search bar to the view. It just doesn't drag. When I try to add it in text it says element item not allowed here?

This is my activity_maps.xml file

 <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/map" tools:context=".MapsActivity" android:name="com.google.android.gms.maps.SupportMapFragment"> <item android:id="@+id/search"     android:title="@string/search_title"     android:icon="@drawable/ic_search"     android:showAsAction="collapseActionView|ifRoom"     android:actionViewClass="android.widget.SearchView" /> </fragment> 
like image 969
anu Avatar asked Mar 06 '15 04:03

anu


People also ask

How do I drag and drop files in Android Studio?

After the user releases the drag shadow, and after the system sends out (if necessary) a drag event with action type ACTION_DROP , the system sends a drag event with action type ACTION_DRAG_ENDED to indicate that the drag and drop operation is over. This is done regardless of where the user released the drag shadow.

How do I drag and drop on Android tablet?

A double tap and hold allows you to grab and then drag. A two-finger tap acts as a right click. A two-finger drag reproduces the mouse wheel scrolling action.

Is kotlin drag and drop?

In most android applications where data is displayed in the form of a list format, there is a functionality with the help of which we can simply drag and drop any item from that list to any specific position within the list.


Video Answer


2 Answers

the new version of android studio uses 2 xml files for each layout. One (e.g. content_main.xml) embedded in the other one (Activity_main.xml). you should open the content_*.xml and do the design in it. hope it helps.

like image 185
Hamed Avatar answered Sep 21 '22 13:09

Hamed


In addition to Hamed's answer I also had to:

File > Invalidate Caches / Restart ...

I'm missing vim.

like image 39
Drew LeSueur Avatar answered Sep 24 '22 13:09

Drew LeSueur