Pete Letkeman wrote:I missed this in my previous post, sorry
Welcome to CodeRanch Manish.
I hope that you will find this community knowledgeable, sharing and welcoming.
One more follow up question:
Are you using Android Studio for this project, Eclipse or something else?
Pete Letkeman wrote:A few quick notes:
1) I did not see "my_ouput_screen_slide_new.jpg", maybe it did not get attached.
2) Your project has more then you have put on GitHub include the "res", "lib" directories and possible more.
3) I would kind of suspect that your output would not be exactly the same as the source code for this project was last update in 2012.
4) Have you downloaded the sample created by Google/Android to see if it produces the same result as your project?
Pete Letkeman wrote:Okay, there are a few different things occurring here:
1) All of your source Java files should to be in the same directory. So ScreenSlideActivity.java and ScreenSlidePageFragment.java should be in the same location as MainActivity.java.
Later on when you get into packages you will see how/where files can be moved.
2) ScreenSlideActivity.java and ScreenSlidePageFragment.java do not have Package statements. Package statements should be the first line in the source file with the exception of comments.
3) Your MainActivity does not contain code to load any other activity.
4) All activities need to be registered in AndroidManifest.xml
You can read more about packages here https://docs.oracle.com/javase/tutorial/java/package/index.html.
This tutorial should help you get started with having one activity load another activity https://developer.android.com/training/basics/firstapp/starting-activity.html which should help with points 3 and 4.
Pete Letkeman wrote:Okay Manish you are making some progress, which is good.
Here are a few different paths that you can do next:
Please back up your project before you do anything else.
Start a new project leaving the current project as is so that you can come back to it later.
Here are a few different tutorials on how to start a new activity by clicking/pressing a button:
http://hmkcode.com/android-start-another-activity-within-the-same-application/ http://www.androidbegin.com/tutorial/android-button-click-new-activity-example/ http://tekeye.uk/android/examples/starting-a-second-activity http://www.androiddocs.com/training/basics/firstapp/starting-activity.htmlI do not know if any/all of these tutorials work as expected.
Once you are able to create a Android program which only loads another activity then I suggest you look into how to load a fragment.
Here are a few different tutorials on how to start/load a fragment:
http://www.vogella.com/tutorials/AndroidFragments/article.html http://abhiandroid.com/ui/fragment http://www.techotopia.com/index.php/Using_Fragments_in_Android_-_A_Worked_Example https://www.developer.com/ws/android/programming/working-with-fragments-in-android-applications.htmlI do not know if any/all of these tutorials work as expected.
Once you know how to load a new activity and how to load a fragment in an that new activity you can then apply that knowledge to your original program.
If you only need on activity then you could migrate some (all?) the code from from ScreenSlideActivity.java into MainActivity.java.
Then as soon as your program starts the fragment ScreenSlidePageFragment would load.
Download the sample program provided by Google/Android and remove what you do not want
Restart at the beginning of the tutorial series found here https://developer.android.com/training/index.html going over everything once again.
Please do not forget to back up your code before making changes to it. This should only take a few minutes to do as you simply need to copy the project files and place them somewhere else.
The total size of this project is most is probably less then five mega bytes so you should have more then enough room on your system for this.
Manish Pamnani wrote:It seems like a lot of work but it also seems to be the prolonged solution that i wished!!
Manish Pamnani wrote:And thanks for replying!!
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database