Affichage des articles dont le libellé est class. Afficher tous les articles
Affichage des articles dont le libellé est class. Afficher tous les articles

mardi 11 août 2015

Android Studio Error MainActivity class Help



Hey guys.I am getting these errors in MainActivity java file when I create new project.I am a newbie.

package com.gaama.learnit;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends AppCompatActivity {

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}
}



lundi 10 août 2015

Class File for SupportParentable in android.support.v4.app not found



So I just upgraded an ADT project to Android Studios, I've spent the day learning about Gradle and converting all the old imported libraries to compile lines, however I seem to be stuck on one final issue. The class:

public abstract class MainActivity extends ActionBarActivity

Is resulting in 21 Errors. The first 4 are

Error: (14, 17) error: cannot access SupportParentable class file for android.support.v4.app.TaskStackBuilder$SupportPar entable not found

Error: (31, 3) error: cannot find symbol variable super

Error: (42, 3) error: cannot find symbol variable super

Error: (47, 2) error: method does not override or implement a method from a supertype

(Rest available if anyone thinks they're relevant)

I have support-v4 and appcompat-v7 compiled:

compile "com.android.support:support-v4:22.2.1"
compile "com.android.support:appcompat-v7:22.2.1"

I've synced, cleaned and ran in all combinations. I'm not sure what step I'm missing here.

Yes I do know that ActionBarActivity has been depricated in place of AppCompatActivity, however switching to AppCompatActivity results in no noticeable changes. My focus right now is to get the project running as is and I'll look into modernizing after that.



lundi 27 juillet 2015

[Q&A] Popcorn V2.5 - ROM for Motorola Defy Froyo 2.2.2 with SD Card Class 10 & GPS F



Q&A for Popcorn V2.5 - ROM for Motorola Defy Froyo 2.2.2 with SD Card Class 10 & GPS Fix Lto

Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.

Before posting, please use the forum search and read through the discussion thread for Popcorn V2.5 - ROM for Motorola Defy Froyo 2.2.2 with SD Card Class 10 & GPS Fix Lto. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.

Thanks for understanding and for helping to keep XDA neat and tidy! :)