A couple of android studio errors

+1 Andrew Sturman · December 7, 2015
Hi all, I recently downloaded android studio and after following Bucky's tutorials I have found a couple of errors occuring.

Firstly I can't seem to add widgets to my app screen. When I drag them onto the phone screen on the xml file in design view it does not let me place them. Instead when I click on a widget and drag it over the phone screen a circle with a line through it appears.

The second problem is that some classes cannot be instantiated. Below is a screenshot of this.


Sorry if these are basic or commonly asked questions but I haven't been able to find solutions for these problems by myself looking online. Thanks to anyone who helps me.

Post a Reply


Oldest  Newest  Rating
0 E S · December 8, 2015
I also have the same problem and also have been trying to find a solution online but to no avail...
I tried the following but didn't help...


So does anyone know how to get around the aforementioned rendering problem??
0 Gary Whitney · December 8, 2015
Two comments:
1. I had rendering problems when I did a new installation with API24.
 * Empty activity was looking for WindowDecorActionBar.
 * Blank Activity did render.
 * Never had these problems with API23
2 Here is some advice on following tutorials and examples.

Maybe this will help.

This is what I believe is going on.

1. Each new version of Android provides a new API level and new features.
2. If you are following someones code and they are using something like extends ActionBarActivity or just extends Activity, that was fine for the SDK API the were using at the time they wrote it.
3. When you start a new blank activity (or in version24 an empty activity), AND the min API you want to support is less than the current API, Android will create the activity extending AppCompatActivity. Id does this so it can support older API levels.
4. The theme is tied to the Activity type the Activity extends.
5. Now here where things go wrong. If Android Studio extended one type and you change it to another type (say to match an example) that new type doesn't match the theme stored in the manifest.

My solution is to not change the Activity type and let the AppComptActivity library do it's job.
0 Henna Bansal · December 11, 2015
Hey Gary, 

Thanks for the solution.
Can you elaborate on where the activity type should not be changed?

Is it when we choose blank activity and other sorts of activities during starting of a new project? Or can I rechange my activity in my current project?

TIA for the help once again,
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator