Posts by Wakim • 10,455 points
263 posts
-
4
votes1
answer71
viewsA: Arraylist adding undue values
The problem is that it is always adding and changing the same object in the list, that is, it has a 16 position vector pointing to the same object. The correct one would be to instantiate and…
-
7
votes1
answer1503
viewsA: How to modify XML elements with Java?
The answer addresses two issues: Resources; Sharedpreferences. Resources To use String's on the Android platform is not necessary to do Parsing of XML. Android has a feature API (Resources) very…
-
1
votes1
answer99
viewsA: Problems when defining the layout
I’m not quite sure the purpose, but it’s not recommended to leave your WebView with limited size, the idea is that it always occupy as much screen as possible, using layout_height="match_parent".…
-
1
votes2
answers1338
viewsA: How to get id of an Imageview on android?
To reply from @Paulorodrigues is pretty cool. But I leave my suggestion, that would extend the ImageView, adding the behavior you want. Of course it involves a Refactoring if you are already using…
-
3
votes1
answer5015
viewsA: Change "button" color by clicking on it or validating text fill
When you use the XML attribute background is giving a StateListDrawable as background of Button. Already when you use Button.setBackgroundColor is overwriting the background with a ColorDrawable and…
-
6
votes1
answer1222
viewsA: How to get the result of an asynchronous task on Android?
It is not recommended (although it is possible) to call the method get of AsyncTask within the Main Thread, because in addition to blocking a task that should be asynchronous it causes a bad user…
-
2
votes2
answers101
viewsA: check function always returning true
Just swap the if’s comparisons of String.valueOf(et15.getText())!=retornadado("bt15") for ! String.valueOf(et15.getText()).equals(retornadado("bt15")) You can’t compare String's or any other Object…
-
3
votes3
answers2263
viewsA: How do I show icon in the Bar action when item is in overflow?
If the idea and have icons in the menus of Overflow Menu and not with ActionProvider then you need to use Reflection to resolve, since icons are not displayed by default. In this case, just…
-
3
votes1
answer2681
viewsA: How to run a back bean method from a Javascript function?
The solution was: Use the p:poll of the first faces or a p:remoteCommand to invoke a action backing bean. <p:poll autoStart="true" listener="#{mBeanTesteIsolado.teste}"…
-
1
votes3
answers1539
viewsA: <f:param sends id null and is released java.lang.Numberformatexception
I suggest a restructuring, not to depend on request attributes, which can be easily lost or forgotten. In case, you can use the f:ajax to add the functionality of Ajax, but keeping the action in the…
-
1
votes1
answer1438
viewsA: Using onclick and onitemclick methods on Actionbaractivity
Forgot to add your ListUsuariosActivity to listen to the events of itemClick and click in ListView, just like you did the first time. Just uncomment the code and replace the new…
-
2
votes1
answer252
viewsA: Return element values without a certain class
I used the dial li:not(.off) > img.imgx that selects all elements with class imgx whose father is a li who doesn’t have the class off. The problem you had is due to the accumulation of two…
-
2
votes1
answer336
viewsA: Toast text out of alignment
The problem is that the attribute android:fitsSystemWindows is specific to declarations of View's in xml layout, not for themes. If you want to keep the theme with this attribute, a "workaround"…
-
1
votes1
answer166
viewsA: How to add an Imageview to a Relativelayout on a runtimer?
Both LinearLayout and TableLayout inherit from ViewGroup. The ViewGroup is the class that has the ability to aggregate and compose the hierarchy of View's. In the case of LinearLayout just call…
-
1
votes1
answer298
viewsA: Shellscript command cd
Just use the command cd ~, with it you will go to the directory home of the current user.
-
1
votes1
answer692
viewsA: Create list with files in different folders on android
As it is filtering by extension you lose the directories in the listing. For this, I recommend to list everything and use an instance of Filter to filter "manually" the files you want, thus keeping…
-
5
votes1
answer3128
viewsA: Identify Android version by some method
Yes, you can check by version constants. In general, for incompatibility handling of some API functions it is common to use the constant Build.VERSION.SDK_INT, that has the information of which…
-
4
votes2
answers142
viewsA: Why this SQL syntax error?
Your script is generating an SQL with the clause LIKE without the simple quotation marks. Something like: SELECT * FROM imovel WHERE 0 OR CATEGORIA LIKE %CASA% OR CATEGORIA LIKE %CASA EM CONDOMINIO%…
-
0
votes1
answer54
viewsA: Problems with Fragments: Activity has been destroyed
The problem is that the DrawerItemClickListener inherits from FragmentActivity. And he’s doing replacements Fragment in a Activity (DrawerItemClickListener) using the FragmentManager, which was not…
android-fragmentanswered Wakim 10,455 -
0
votes1
answer86
viewsA: Android: Unfortunately, Sample has stopped
By Stacktrace posted, the problem is that it is converting a String in format float for a int. I don’t know if your intention is to treat the field value as integer or decimal. To treat as integer…
-
2
votes1
answer144
viewsA: Paypal IPN for recurring cancellation payment
I believe there are two things wrong: The mapping of Servlet is wrong. The <servlet-class> must be <servlet-class>br.com.spacnet.util.IPNListenerServlet</servlet-class>, since the…
-
1
votes1
answer555
viewsA: Take position of the arraylist that is in focus in Viewpager
To get the position that is being displayed, just use the method ViewPager.getCurrentItem(), it provides the position for the item being displayed from PagerAdapter at the moment. To access the…
-
2
votes1
answer5276
viewsA: How using actionBar appear icon + text of items?
The solution I’m going to detail makes use of the ActionLayout of MenuItem, which is available both from the Android 11+, as in previous versions, but with the use of v7 support library AppCompat.…
-
1
votes2
answers7960
viewsA: How to close an Activity(remove from Foreground)?
This area that is showing in the image is the Recents Screen. When an app appears there, it is not necessarily on foreground, but it was recently used, possibly closed (as is your case). You can…
-
2
votes1
answer656
viewsA: How can I within a class extending from Broadcastreceiver make any changes to the graphical interface?
There are several ways to update the View of a Activity of an external class, I will illustrate two that are easy to implement: 1. Using the Pattern Design Observer (Listener) Definition of the…
-
3
votes1
answer1852
viewsA: Modal bootstrap does not load Google Maps v3 correctly
The problem is I was running the bind before the DOM have been built in full. Soon the selector $('#mapmodals') was not bringing any element and so did not call the function set for the event, which…
-
6
votes1
answer14768
viewsA: How to speed up Android Studio + Gradle?
There are some settings that can help to give an accelerated in the process of build of Gradle: Always use the latest versions of Android Studio, Gradle Plugin and Gradle. Perform the following…
-
1
votes2
answers469
viewsA: Shopping/Restoration inside the app on Android
The purchases made by Google Play in-app Billing v3 are always attached to the user’s account on Google Play, no matter if it removed your app, formatted the device, bought another one. As long as…
-
1
votes1
answer102
viewsA: When I press play button nothing happens
As the button has been disabled, it does not notify events to View.OnClickListener. Simply remove the setEnabled(false) on startup of your button: private void initControls() { playButton =…
-
1
votes1
answer342
viewsA: Fetch data from a particular column and display them in a Spinner
The Cursor Android starts with index 0. Exchange the modelos.add(cursor.getString(1)); for modelos.add(cursor.getString(0));. You can refer to the index of a column based on its name, using the…
-
4
votes3
answers1008
viewsA: How to improve my code (many If’s and Else’s)
You can reduce these if's checking only the upper limit of the range, and taking advantage of the order in which conditions are assessed to fit the value into the correct range. Be careful because…
-
1
votes1
answer115
viewsA: Return only albums with at least one photo
Unfortunately there is no possible manipulation for this purpose of filtering or sorting results, the Graph API is very rigid in this regard. Like version 2.0, which still supports FQL, will be…
-
2
votes1
answer1138
viewsA: Spinner shows no selected item
Ah, I understand the mistake. Forgot to call the method notifyDatasetChanged in his ArrayAdapter. This is necessary because you are adding the items directly on ArrayList estados. Alternatively you…
-
1
votes1
answer666
viewsA: How to use ksoap2 library
Anderson, this error you made is not directly related to your connection code. This error is due to where you are running an internet connection on MainThread. It is not recommended to perform…
-
2
votes1
answer124
viewsA: How to show ad when closing my app
To achieve the solution you must overwrite the method onBackPressed of Activity. A solution would be: public class SuaActivity extends Activity { // Demais codigo de sua Activity... @Override public…
-
1
votes1
answer2514
viewsA: How to create buttons with dynamic size in XML?
There was a little problem in his Layout. I was defining your TableRow without the attribute layout_width, he soon assumed as wrap_content, and was using the layout_height with fill_parent, which…
android-layoutanswered Wakim 10,455 -
15
votes2
answers4535
viewsA: How to apply internationalization in an Android app?
No, it’s not just how you do it i18n in an Android app. This way is only relative to the language in which your app is shown in Google Play, does not affect how your app texts will vary for each…
-
1
votes1
answer952
viewsA: How to use zipalign in Andriod Studio?
Just copy the zipalign of the briefcase android-studio\sdk\build-tools\versao_do_seu_build for android-studio\sdk\tools. There was a recent migration on the SDK (before it was in this folder…
-
6
votes3
answers95
viewsA: How to use this!
In your case, missed to iterate over the buttons, you iterou only in the div#botoes, needs to iterate on the children of this div that encompasses the buttons. That way your code would be:…
-
0
votes1
answer384
viewsA: Listview android , marks items wrong
Edit As the intention was to make a line selection algorithm, the previous solution did not fully meet, making the new solution simpler. In the new solution, the Adapter has a SparseArray (could be…
-
0
votes1
answer270
viewsA: Display current date in Viewpager manipulated layout
The ViewPager works in a similar way that the ListView, displaying a small part of the associated model. The Model is associated through a Adapter, where it is responsible for returning the visual…
-
5
votes1
answer764
viewsA: How to allow my app to be moved to memory card?
Using the property android:installLocation tag <manifest> you can control the installation location of the application. There are three possible values: internalOnly, which is the default if…
-
1
votes4
answers1387
viewsA: How do I know if it’s a tablet or a smartphone?
As this question is interesting and this issue of correctly identifying Tablet’s brought me problems too, I managed to solve. I leave my solution to the problem: Like I said, I was using both the…
-
0
votes1
answer747
viewsA: Problem with Google Maps when creating . apk
The solution found to the problem, during several attempts of possible errors, is the use whenever possible of the same certificate for all builds. If this is not possible or desired, you need to…
-
1
votes1
answer692
viewsA: Problems sending data from one Listview to another Activity
There’s still plenty to be done on this one Adapter. I will try to make a general outline in the solution. The points I will address: Lack of storage in Adapter what is the answer to each question,…
-
0
votes1
answer87
viewsA: Java Bounceball Bubble Movement - Error
His code had some logic that I didn’t understand very well, regarding the detection of the collision with the mouse. I made my own, where I just check if the distance between the position of the…
-
2
votes1
answer68
viewsA: Problems with Asynctask in second Activity
Forgot to assign the ConsultaSituacaoListener to his ConsultaSituacao. On the line: listener.onConsultaConcluida(result); you make an access to a null object, generating the NullPointerException.…
-
2
votes2
answers2564
viewsA: Mark all checkboxes of a Datatable table?
I recommend using the pagination event: page.dt, that is fired whenever any pagination is made. Note: If your table has sort or filter, the table is redone, so you need to redo the markups. To do…
-
2
votes3
answers176
viewsA: How to get the line separation of the system
In the specification of ECMA a section 7.3 only sets the grammar and possible tokens recognized as line break. As there is no exact way to find out the characters of the line break. I log a…
javascriptanswered Wakim 10,455 -
18
votes1
answer1570
viewsA: How to find out if Javascript is disabled?
There is a tag <noscript> for this purpose. It is rendered only when Javascript is disabled or not supported. An example would be: <noscript>Para continuar habilite o…