I'm newbie to android and must use image as Pinterest. i am using staggeredgridview using etsy demo but as soon as project is imported to eclipse it shows many errors is there any step to implement staggered demo?
Try Below code..
https://github.com/bulletnoid/StaggeredGridView
Hope Help you.
if the Existing Code is Correct, and It shows An error when you import the Project You need to Take Care of two things..
If you want to seed Demo... if a Existing Projects... it Depends on the Way You Import.
1.Some Existing Source codes can Be imported directly..
Like :
File>
Import >
Android >
Existing Android Code Into Work Space> Browse file..
But For Some Source Code In the Above Way you will Get Errors Definitely.. Due to incomplete Import..(I mean Eclipse may not import Complete Functionality)
If you Get Errors in First Way choose Second Way..
2.Second Way to Import
File>
other>
Android >
Android project from Existing Code> Browse file..
I hope this is Problem..
Or Else Please Mention Your Log Cat Code so that the Error will be Fixed..
Update
One More thing If you are Using Android Build Tools.. It may a problem for some old codes..
So you need to Use Separate Eclipse J2EE kepler IDE and Android SDK ...
See here for Reference...
One Place Your Log Cat.. I will Solve Problem...
You can go with this link:
It explains few steps as follows:
Just Use a Grid List
Try a Modified GridView with Staggered Grid View
Try a Modified List with Pinterest Like Adapter View
Or Try Two Synced List Views with Pinterest List View
You might not have change your Package Name or i would be good if you have posted error.
Related
so i'm following a guide online to make a room db. In the adapter section i followed his way of doing it but when i did it, i keep having the "No Type Argument expected for Interface ListAdapter".
Error example: https://imgur.com/kPT7DkE
Here's the whole project so far on github.
https://github.com/OlivierLabelle/BudgetProject/tree/master/app/src/main/java/com/example/android/budgetproject
And the guide i was following.
https://medium.com/#trionkidnapper/recyclerview-more-animations-with-less-code-using-support-library-listadapter-62e65126acdb
So with the help of devboi, i found out i was using the wrong import.
In the top right corner on the Dev documentation it show the right import.
https://imgur.com/vGrCOVd
And here how the import on my project should look like.
import android.support.v7.recyclerview.extensions.ListAdapter
Just came across this very problem myself.
If you're using AndroidX/Jetpack/whatever the official name is I'm still new at this, Android Studio might
import android.widget.ListAdapter
automatically, but the one you want is
import androidx.recyclerview.widget.ListAdapter
From what I see in your code, you should replace ListAdapter<Transaction> with ListAdapter<Transaction, Viewholder>.
You can see an example in the docs here :(https://developer.android.com/reference/android/support/v7/recyclerview/extensions/ListAdapter.html), where ListAdapter has 2 arguments inside the diamonds: one for the list-object and the other for your custom viewholder.
Hope this helps.
I am trying to rename my eclipse android project. I have tried Android Tools -> Rename Application Package. It gave me an error occurred see log.
I can't find any logs and suddenly this happen my project structure shows some blank and garbage packages as shown in picture.I tried deleting it but deleting them deletes my source code too.Any idea will be very helpful..
You can rename classes, packages and projects by right clicking on the class/package/project and choose: Refactor -> Rename. Check the Update references box to make sure all references to the project/class are also changed.
This behavior is totally ok.
A java package corresponds with an folder.
When a package/folder is empty eclipse will show it as "white boxed" without content (no arrow).
Example:
The class "AClass" in "com.me.pckg" corrensponds with
com/me/pckg/AClass.java
This means folder "com" and "me" contains no files. Eclipse represents this a "white boxed" packages (com and com.me). Package "com.me.pckg" is not empty.
Aware eclipse does not show the package structure NOT as hierarchical as you expect it in a file system view.
Vice versa if you put some file/-structure in your project eclipse will show new folders a packages. This happens after a refresh or a restart of eclipse, the later may be perceived as a sudden action.
If you want to change the type in "com.demo.alaramdemo" use Pieter12345 answer(, or just change the name of the folder in the file system)
If you want a more file system like view within eclipse use the "Navigator"-View
Finally i got the answer to this, With the help of a post above by Stefan
and a solution mentioned here on below link http://www.coderanch.com/t/105581/vc/Eclipse-hide-empty-packages
actually i had to create filters available on a inverted triangle in package explorer header.
In that u have to check filter of empty package , empty parent package etc
it worked for me.
Thanks all for the help ... :)
I'm trying to create my first app with Android but I've encountered some problems.
Following a tutorial and making:
new android application -> blank activity
The default result should be:
With MainActivity.java and R.Java inside it.
But instead I've got this:
There are a lot of errors and the R.Java file is missing.
I can obtain a result similar to the tutorial one (with no errors), creating a new android application and unchecking create activity, but this time MainActivity.java under src is totally missing.
Maybe I could copy the MainActivity.java of the first project and put into the second one, but I prefer understand why it doesn't work.
Thanks for the help.
Best regards.
its import library problem
Right click on you application----->Android
under library view ,
check if you have this red error then remove the library and add it again
I am trying to work on my android app from my phone and tablet using Aide. I keep getting hundreds of errors. It seems as if it is only detecting one library project at a time. I can change which errors I get by removing a library and adding a different one (I am using three)
Has anyone successfully used multiple project libraries in aide, and might be able to offer some assistance?
My project . properties looks like this:
[Eclipse references (I think)]
android.library.reference.1=../../../../libraries/android-greendroid/GreenDroid
android.library.reference.2=../../../../libraries/ActionBarSherlock/library
[Aide references]
android.library.reference.1=/storage/extSdCard/code/android-actionbarsherlock/library
android.library.reference.1=/storage/extSdCard/code/android-facebook/facebook
android.library.reference.1=/storage/extSdCard/code/android-greendroid/GreenDroid
android.library.reference.1=/storage/extSdCard/code/android-actionbarsherlock/library
android.library.reference.1=/storage/extSdCard/code/myproject/android/free
So, the aide references are all .1 and there are no new lines between them.
I also had the same problem and fix this formating references like in eclipse.
Like this:
[Eclipse references]
android.library.reference.1=../../../../libraries/android-greendroid/GreenDroid
android.library.reference.2=../../../../libraries/ActionBarSherlock/library
[Aide references]
android.library.reference.1=/storage/extSdCard/code/android-actionbarsherlock/library
android.library.reference.2=/storage/extSdCard/code/android-facebook/facebook
android.library.reference.3=/storage/extSdCard/code/android-greendroid/GreenDroid
android.library.reference.4=/storage/extSdCard/code/android-actionbarsherlock/library
android.library.reference.5=/storage/extSdCard/code/myproject/android/free
You can't edit project.properties in AIDE, so use text edit and fix this. Put enter in right place and fix reference number ;)
How do I fix this? I already tried removing the R.java and cleaning the project via eclipse, but it doesn't help.
FYI I am trying to get PhotoStream from here: http://code.google.com/p/apps-for-android/, but so far it has been very difficult to get things work.
Okay..... 5 mins later google tells me the correct answer...
http://www.fairtec.at/en/it-blog-mainmenu-16/168-the-type-r-is-already-defined
I just didnt search hard enough.
"The type R is already defined"
That's the message you get in Eclipse if you try to build the Funambol Android Sync Client.
Reason is that you have checked two Builders that try to generate the same class.
You just have to uncheck the Java-Builder from Project->Properties->Builders.
Then the application even works fine in the Emulator.
Delete the R.java from the src folder and rebuild the project. This file will be automatically rebuit during this process.
http://www.fairtec.at/en/it-blog-mainmenu-16/168-the-type-r-is-already-defined
click right to project click properties
Project->Properties->Builders.
unckeck java Builder
delete file R.java
You may want to change your package names. It looks like you are using a 'PhotoStream'.jar which has it's R.class defined at the same package structure as you.
Here is a link to the R.java from the project on Google Code. Notice you are using the same package:
http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/R.java?r=83
I had the same issue when I imported a project from work. Turning off the Java builder as suggested in the article you found fixed my problem, but when I made code updates they were not reflected in the running app. In my case there was an R.java in my source which I deleted and that fixed my problem.
In my case,
as i m not using any IDE for programming but using command line Android..
i had two xml files, one in layout and other in layout-land. i was using same id "XXX" for both but while declaring i made small mistake
android:id="#+id/XXX" (in layout xml)
android:id="#+id/XXX " (in layout-land xml)
please observe extra space in second id declaration, so while creating R.java they were different and in R.java i had
public static final int XXX=0x7f040046;
public static final int XXX =0x7f040045;
which are same, so please be aware of extra spaces. Thank you