Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (101)

Sign In or Sign Up now to post a comment!
  • For me the issue was that I'm use to ending all lines of code with a ; and I had android:background="@drawable/­splash_background";> deleted the ; and it's resolved. This was causing the R.layout.splash and the R.id.* to error out. I don't know if this is what anyone else was experiencing, but hope it helps.

  • so, i went through hell debugging this. first the splash wouldn't work at all. just got the add/sub program. i read that it may have been the version of the SDK or whatever, so i went and started a new project with 2.2, which ended in failure. SOLUTION: (Bundle savedInstanceState) instead of TravisLovesBacon or whatever. the splash.java and startingPoint.java have to have the same variable name in the bundle parameter or whatevs

  • Here is the easiest fix. All you have to do is type in R.layout.main. Change main for database. You do not need to delete the android.R or import anything. Thumbs up so others can see.

  • "splash cannot be resolved or is not a field"

    anyone know what I did wrong? Everything looks the same. I've closed out of eclipse and restarted, which sometimes helps. And Cleaned it too...

  • I wish my middle & last name were "love" & "bacon" respectively. :(

  • how do i run my app in the virtual device?

  • @freaky3ro Just click Run. If you have a phone plugged in to your computer, it will try to run it on the phone. Just remove the phone and it should run in the emulator (virtual device).

  • Thanks Travis for making this tutorial series...I have been following them carefully and they are really helping me learn about making android apps.

  • Everyone learning android from this tutorial..if your image isn't being detected in the setContentView( ) method, you can fix it by just deleting the "import android.R" directive from the top of the file..

  • Comment removed

  • Comment removed

  • Comment removed

  • so can someone explain to me what the setcontentview() function actually does? I cant find a clear explanation for it :p

  • @XxKrNaGexX what setcontentview() does is it allows you to select a different layout file, so you can make different pages in you application

  • thenewboston i want to ask you that i can try this for windows 7?I mean that the settings are same?

  • my button noise was called button1 and u cant have numbers in the names -.-

  • hi, i m not sure why but my splash is in View but not in "int" as in the tutorial, i have deleted my splash.xml file again and again for several times and I still can't go through it !

  • Very good tutorial...for the most part.

  • @lxLionHartxl empty Activity. Sorry about that.

  • Comment removed

  • Comment removed

  • Good video.

  • and it solved the problem :)

  • instead of " import android.R; "

    i did like this " import com.thenewboston.travis.R; "

  • @MrButtonclick Don't import the fully qualified name....just Delete the "import android.R" directive at the top...as others have said. This appears periodically when you "Clean" your project. After you delete it, the R.java file will be regenerated automatically and should correct any potential errors in the source location.

  • void isn't a method, it's a type

  • Problem with R.layout.splash - my solution:

    i do 2 thing, can't realy say what worked:

    First: i did like tuttar3 said: add to splash.java - import packege_name.R;

    Second: i deleted music file from folder "raw"( in name i used capital letters and Travis said in tutorials, that it is forbidden to use capital letters), so maybe error pop up becouse of capital letters in file name

  • @xsxgotenxsx check in everyone's post...thanks

  • How can you even pretend to do Android development without knowing the language? Learn java then droid development.

  • Help pls..... i created new project so i could go get the gen folder that keeps disapearing.... and when i clean project so the R. error goes away Gen files keep disapearing

  • helpppppp R cannot be resolved to a variable..ERROR

  • at 1.48 seconds when you have to "import the activity class" i do not get that option. i get all the rest below but not the one in the tutorial.

  • setContentView(R.layout.splash­);

    Can not resolve, and typing it manually does not bring up

    com.(projectName).android.R

  • me too. was there a resolution to this?

  • @delphi202002 Making a new splash.xml in layout solves the problem, I had to google for what to enter in there and found this page wwwDOTbarebonescoderDOTcom/201­0/04/a-simple-android-splash-s­creen/ it tells you what to enter - you need to rename the appropriate parts

  • @delphi202002 i went through the tutorial for the splash screen agan and now it works...i think i may have missed a capital letter in Activity

  • protected is not the same as private, private methods are only be accessed in the class where they are in protected can be used in classes that extend

  • you say "for the most part" alot

  • ur the same guy as cornboyz

  • If you guys got a ton of errors after you hit "Clean" in the last tutorial, you have to make sure that all of the files you put in the "res" folder (your background image and button sound) are all named without any spaces or weird characters. Then you need to go to the "Project" tab where you hit "Clean" before. Then uncheck the "Build Automatically" button on the dropdown menu, then right-click your project name on the side and click "Build Project". Then just hit "Clean" again. Hope it works:)

  • home made java!!! :)

  • the emulator start tooooooooooooooooooooo slowwwwwwwwwwwww

    how can i fix this? it takes half of an hour to run this tutorial apps!!!!

  • Can you please assume people have a basic understanding of programming as you make tutorials on specific technologies (eg: Android development). Maybe also let people know that if they are not familiar with basic concepts of OOP or Java that they should see your other tutorials.

  • How do you edit the emulator's window size? It's TOO huge for my screen.

  • Could someone help please!!! whenever i try to click on the source and overide implement methods it says no method to override found for this type

  • Anyone know how to get the emulator to start fast like Traivis'? Mine shows two screens, then I have to swipe the unlock swiper to get it to run my example code

  • Love Bacon!

  • This is a FIX for the R problem.

    Sometimes Eclipse likes to import R in the top of your class, delete this and import the R which is related to your project instead!

    If you need more help, reply.

  • @CaptainMack16 help... So fx if i named my src package "com.abe.dansk" i simply say:

    import com.abe.dansk.R;

    Instead of:

    import android.R;

    or what?

  • @tuttar3

    Well delete the android.R and hover over the layout code and you can click to auto-import. But yes, as I remember it's just package name and .R on the end.

  • @tuttar3 That's exactly right. After you've changed it to that, try right clicking on the project's name and say Build Project. Your errors should be gone now hopefully.

  • @CaptainMack16 im getting the error and theres no import on top of the code... :(

  • @hazzncrazy what editor are you using? It _has_ to import R

  • @CaptainMack16 hey, I need help, I am not sure how to delete the import R? I recognized that I have not imported it in the first place?

  • @thetmonaye It is sometimes imported automatically, but it is the wrong R, that is imported. Check the top of the code and see see if the imports are collapsed, press the plus to see all imports afterwards, see my reply with the solution so you imported the correct R related to your project.

  • @thetmonaye hey I got it but now the splash stops very soon and didnt connect with the app :(

  • void means that it doesnt have to have a return value.

    if u had public int Number(int Number)

    you would have to return an int.

  • Hey everyone,

    I'm also stuck. Perhaps someone will help c:

    In StartingPoint.java on the line: setContentView(R.layout.main);

    i get an error "main cannot be resolved or is not a field"

    so i click the lightbulb x error icon and it says "Rename in file (Ctrl+2, R)"

    I tried deleting ''import android.R'' statement at the beginning but then R 'cannot be resolved to a variable'

    Also when we click 'Override/Implement Methods' i get 'No methods to override found for this type.'

    help a newb!

  • For all of those people having trouble with the (R.layout.splash) problem, this may be the reason why. Check to make sure your R.java class is still this, under gen. If it is not, then start a new project. You can repeat class names and copy and paste most of the things. Another sign that this is what you need to do is that under your startingPoint.java class the (R.id.bAdd) and the other of those type will also have a problem. Hope this helped!

  • great

  • Ok, so apparently Eclipse will add an import android.R statement at the beginning of your java files. This is wrong and should be deleted. I deleted mine and ran the program and it resolved the splash error.

  • Comment removed

  • Can someone please HELP me get past the R.layout piece which for the life of me can't find where the problem began at within this tut. I read all the comments, played around with suggestions, but am coming up empty each time. Thanks everybody

  • @Alpentalrider Delete import R; 

  • @Alpentalrider

    Make sure the Class splash.java is in the same package. In this video the class have to be in com.thenewboston.travis

    greets and merry christmas :)

  • I have the same problem, also with R.id., none of the references to the xml pages seem to work, or stop working after a while for no reason. Any solutions?

  • Hey, I really appreciate these tutorials, but I gotta file a gripe...

    I think you need to do a better job of following Java standard practices. In this tutorial you finally at least noted that you started a class witha lower-class letter (but didn't fix it!). But then you went on to start a variable name with an upper-case letter!

    For inexperienced Java developers, you're setting some very bad examples. For experienced Java developers, you're driving us crazy (for the most part =P)!

  • These are good Android tutorials, but he's expecting you to know Java. He says he isn't, but if you don't already know Java (or at least the basics of Object Oriented Programming) you're going to be very lost very fast. You should really watch at least the first 10-15 of The New Boston's Java tutorials.

  • @chaimss Thanks, that clears up some stuff.

  • @chaimss If you listen to the first one or maybe it was in the description, bucky(the dude who did the first few tutorials) said watch my java tutorials first.

  • @chaimss yep

  • @chaimss u mean 100 - 150

  • If your last name is bacon the r u related to Kevin bacon?????

  • A good way I was taught to think of activity's is the equivalent of one page on a site

  • Bucky and Travis, they both love naming variables 'bacon'

  • @SkimpyDoughnut

    I also got the same error.but in the video,in layout folder i saw a splash.xml

    We dont have it on our project.from where are we supposed to find that xml file??

  • @rehrumesh Find the xml and put it in your layout folder

  • And then everyone watching this video began calling their loved ones "love bacon"

  • Guys do go through Bucky's or Travis's Java tutorials if nothing makes sense

  • Every time I try running the application in the Emulator, I get the stopped unexpectedly error.... Any fixes for this?

  • @letzshuffle95 switch Graphical Layout tab of main.xml to Android 2.2 and in Android Manifest make sure android:versionName equals 2.2

  • Super means the class that's this class' master. This class extends Activity, and therefore is Activity the master of Splash. For example: You have the onCreate of monsters, and the onCreate of AlienMonster. AlienMonster extends Monster to implement the monster basic attacks and movement code. It runs the constructor, or in this case, onCreate. And in this case, it runs the onCreate of alienMonster, then runs the code of Monster to add movement and stuff, and the proceeds with alienMonster.

  • Quick tip: Instead of writing "extends Activity" and that, when creating a class at the "Superclass:" line, click "Browse..." and write/select Activity

  • @X3N4T3 good tip thanks

  • for some reason I got an error with

    setContentView(R.layout.splash­);

    where the "splash" variable isn't recognised?

  • @SkimpyDoughnut Me too :(

  • @SkimpyDoughnut I found out now.

    Get rid of the line, then start typing the code manually

    Type until you get to the brackets and press R. then wait until the list comes up

    then you want to type Layout then look for the layout with com.(projectName).android.R underneath the words layout and click that then put splash afterwards

    hoped it helped

  • Comment removed

  • @mangopearandapples I don't get one with (projectName).android.R

  • @mangopearandapples Nevermind! Got it working again! I just remade the Java file! :)

  • @SkimpyDoughnut ..even I was having splash problem...I too remade the java file and then it came...thanks for the post...

  • @SkimpyDoughnut That was a very simple fix for a problem that was driving me bat-shit insane. Thank you, sir.

  • Thanks for not making the tutorials extremely long. Seems like I get more videos done quicker!

  • more tutorials ! :O

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more