Posts by Wakim • 10,455 points
263 posts
-
3
votes1
answer76
viewsA: Problem with select in Knockoutjs and Mootools
Right as I said, is to use the BindingHandler of options in a select. Your HTML would get smaller: <div> <select data-bind="options: animais, optionsText: 'nome', optionsValue: 'id'" />…
-
2
votes1
answer4434
viewsA: Check if it contains Data in Sqlite table
There are two ways to do this: Using a SELECT COUNT: // Obtenha a instância de SQLiteDatabase SQLiteDatabase db = ...; Cursor cur = db.rawQuery("SELECT COUNT(*) FROM TABELA", null); if (cur != null)…
-
5
votes2
answers5295
viewsA: Reduce the size of an APK file
With the inspiration and excerpts of the Rafael, below follows my adaptation to the Linux platform. Requirements: 7zip, to install: sudo apt-get install p7zip-full. unzip. jarsigner, located at JDK.…
-
3
votes2
answers5005
viewsA: Run a method in Managedbean when initializing the Page
There is a note that fits exactly in your case. Use the annotation @PostConstruct to define a method that is executed as soon as the ManagedBean is built (according to the life cycle of your Bean),…
-
3
votes1
answer792
views -
2
votes1
answer1368
viewsA: Change the color of the tab indicator on Android
The FragmentTabHost returns the TabWidget (only one), which is the View responsible for drawing these tabs. Each child is a different tab. The color setting of Tab of Style Generator applies only to…
-
4
votes2
answers841
viewsA: Problem with jQuery open/close Divs
In this case, since you have multiple questions with equal markup only by changing the content, I recommend using the selector context instead of using the index. The pattern that repeats for each…
-
4
votes2
answers1558
viewsA: Return parent tag ID when clicking a button
Use the parentElement to obtain the element DOM relative to the father. The parentNode is only for compatibility with very old browsers, but can be removed. function checkbox(child) { var parent =…
-
1
votes1
answer199
viewsA: Dynamically change the margin of a Checkbox
Edit: As the View which must be above CheckBox is generated dynamically, this solution using RelativeLayout.BELOW does not meet and generates problems even adding a id auto-generated. To each…
-
4
votes2
answers5853
views -
1
votes1
answer192
viewsA: retrieve a background name from a textView
Edit As explained in the comments, the form previously proposed does not meet. Soon I’m proposing another, using custom states, I believe a cleaner and more correct way. The steps are as follows:…
-
3
votes1
answer1090
viewsA: Non-static variable cannot be referenced from non-static context
The problem in this case is that you are trying to access an instance variable in a static context. Instance variables belong to the scope of a given object, an instance of a class. If for example…
-
3
votes1
answer2731
viewsA: Back button closes app
The problem is the use of the attribute noHistory="true". Removing it will solve the problem. According to the documentation, use this flag is the same as calling finish at the beginning of any…
-
4
votes1
answer4823
viewsA: How do I export an . apk android in Android Studio?
Your procedure is correct, but the problem is that Gradle rewrites these attributes in AndroidManifest. Search the gradle.build of its main module, by the following: defaultConfig { applicationId…
-
0
votes1
answer1201
viewsA: Dynamic notifications, through parameters, on Android
Just as you pass parameters of BroadcastReceiver to the Activity of the notification, you can pass parameters to the BroadcastReceiver of Activity who called. In your code it would be: @Override…
-
1
votes1
answer2637
viewsA: Validate Date entered by Edittext
The easiest way to validate would be by using a SimpleDateFormat and using the flag of lenient class DateFormat. The standard is true, to capture formatting errors should use it as false.…
-
1
votes1
answer802
viewsA: Expansion file stopped working when updating APK version
As much thing on the Android platform, even more related to google is not always well documented, the statement of <provider> of Expansion takes two parameters. Which are used in this…
-
2
votes1
answer57
viewsA: Which method is triggered when changing a value in the Preferenceactivity class?
The class Preference, as well as various elements of Android, have events. In the case of the class Preference, she has two winds: OnPreferenceChange and OnPreferenceClick. I believe the first is…
-
1
votes1
answer484
viewsA: Setting a view at the bottom
When you wear one ScrollView, the use of match_parent is different than in a ViewGroup. Like quoted by Romain Guy, a former AOSP developer, the ScrollView has a different dynamic from the others…
-
4
votes1
answer98
viewsA: Pass "visibility" as parameter
The method parameter setVisibility class View, is int. and has the following possible values: View.VISIBLE = 0x00000000 View.INVISIBLE = 0x00000004 View.GONE = 0x00000008 So in your method just make…
-
3
votes1
answer229
viewsA: How to disable all Textview of an Activity?
There is no method in Activity to do it automatically. The only way, generic (without having to disable element by element manually), would be to iterate over all layout elements and disable one by…
-
0
votes1
answer1521
viewsA: How to take the margins of the Android layout
To take the effect of the View which gives the line effect I suggest to encompass its layout in a LinearLayout and put the RelativeLayout below the View. Thus: <LinearLayout…
-
1
votes1
answer126
viewsA: Remove Actionbar Tabs indicator on Android
Removing the Indicator is not easy. The background of Tab of ActionBar is stylized that way: <?xml version="1.0" encoding="utf-8"?> <!-- Licença, omitida por espaço --> <selector…
-
4
votes1
answer3256
viewsA: How do I use $_GET to pick up content from a link that was sent to a user’s email?
As mentioned in the comments, on your password reset page there is a form with the URL of your script: //Não sou expert em PHP, mas vou supor que está escrevendo a //variável $_SERVER['PHP_SELF'] no…
-
2
votes2
answers994
viewsA: Error 403 when trying to "synchronize project with Gradle"
It seems to me that Jcenter does not yet have the com.android.tools.build which is used in Gradle to build apk. Packages exist (the url for it is:…
-
1
votes2
answers122
viewsA: android.permission.MODIFY_PHONE_STATE - How to assign system permission?
Unfortunately it is no longer possible to get this permission. From Android 2.3+ this permission was limited to only system applications. In itself documentation is cited that it is not for third…
-
3
votes1
answer375
viewsA: Httpresponse java
Use the Java JSON API. From the String in JSON format, you can build a representation in memory and extract the data you need: HttpResponse responsePOST = client.execute(post); String responseBody =…
-
9
votes2
answers35944
viewsA: Taking time in format: HOUR:MINUTE:SECOND
A very simple way is to use a SimpleDateFormat: SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); Date hora = Calendar.getInstance().getTime(); // Ou qualquer outra forma que tem String…
-
1
votes2
answers5728
views -
3
votes3
answers1459
viewsA: Parse Complex of JSON
GSON does Parsing correctly if the field name is equal to JSON. Because it uses Reflection to deserialize the nested object. The attribute listChampion stays null because it makes a direct…
-
1
votes1
answer167
viewsA: Spinner in Popup
I believe that String "TextView" that is returned from the method getItem of your Adapter is the problem while recovering the selected item. Change your Adapter to: public class SpinnerAdapter…
-
3
votes1
answer1415
viewsA: The JSF Autocomplete component does not work
The problem with your code is that you are using the attribute cidades_do_Contrato (completion of the autocomplete) and not the indiceCidades created by foreach, as a comparator during the iteration…
-
1
votes1
answer280
viewsA: Android: Align Parent Bottom + Bottom margin programmatically
To add programmatically I used the following code: RelativeLayout r = new RelativeLayout(this); // O padding eh setado direto na View r.setPadding(100, 100, 100, 100); // Recupero o pai…
-
1
votes2
answers1113
viewsA: Tooltip or Hint in rowEditor in Primefaces
Macario, I used the pseudo-element :after to build your tooltip. Of course it can be stylized, I just did the least so that when you hover the mouse over the element you need, it appears. Also had…
-
2
votes1
answer1344
viewsA: How to change Textview of a View in another View?
If you need to customize the View of an item of ListView create a subclass of SimpleAdapter and include the customization logic in it. For example: public class MeuSimpleAdapter extends…
-
2
votes3
answers637
viewsA: Alternative to the Enterprise Architect
As a suggestion, I strongly recommend the Astah*. It has native build for Linux (Mac OS and Windows also) and has long been in the market. It started as Jude and then changed its name to Astah*. The…
software-engineeringanswered Wakim 10,455 -
2
votes2
answers304
viewsA: How to access specific <ul> items with :Nth-Child()?
You can your pseudo selector nth-child adding the odd or even rule (odd or 2n+1 and even or 2n) to customize the elements. To customize even items would look: li:nth-child(even) { // Seus estilos }…
-
2
votes1
answer359
viewsA: java.lang.Runtimeexception: Unable to start Activity Componentinfo java.lang.Nullpointerexception
I believe the error is in your table creation command. Is concatenating the column statement telefone comma-free. I don’t know how it didn’t generate syntax error. With the current code your command…
-
0
votes2
answers895
viewsA: Manipulating a List inside a foreach in a view
Using the forEach of jstl exists the attribute varStatus exposing an object of the type javax.servlet.jsp.jstl.core.LoopTagStatus in the iteration scope, which provides some data about the object…
-
1
votes1
answer34
viewsA: ALIGN_BOTTOM in relation to the Parent class
According to the method documentation addRule. Use the ALIGN_BOTTOM means you want to line up a View in relation to the background of another View with the id specified as anchor. However, make this…
-
1
votes1
answer170
viewsA: Show View as slide
I will assume that the content behind the slider is not part of the question. Only the slider implementation will be addressed. In my solution, I made use of Android Sliding Up Panel, as an example…
-
1
votes1
answer1646
viewsA: Creating a customized and animated toggle
To do this effect, I made an auxiliary class to listen for events of Motion in the ToggleButton, that in sequence: Starts an alpha animation from 1 to 0, leaving the ToggleButton transparent. With…
-
1
votes2
answers71
viewsA: Animation does not repeat in android api 8
Using the ObjectAnimator it is possible to make this animation easier: ObjectAnimator flashLight = ObjectAnimator.ofFloat(imgLight, View.ALPHA, 0f, 1f); flashLight.setDuration(speeds[speed]);…
-
10
votes1
answer6083
viewsA: Send an Arraylist of objects to an Activity
There are three simple ways to pass a ArrayList as a parameter for a Activity. Static methods: In the ActivityA // Dados a serem passados ArrayList<Tipo> dados = ...; Intent i = new…
-
0
votes1
answer2120
viewsA: Recover data from Fragment
To better understand why the onPause of Fragment A is only called when it goes to the Fragment C, I’ll try to explain the behavior of ViewPager. Viewpager by default only stores 2 items in memory.…
-
1
votes1
answer1885
viewsA: Webservice almost 100% (Rest/json)
Your code has two problems: Is returning a String that is not in format JSON of a Webservice that should return JSON. That’s what I’d have to do: package com.rodasdo; import javax.ws.rs.Path; import…
-
3
votes1
answer1917
viewsA: Tomcat: Application at context path /Project could not be Started
The cause of the problem is java.lang.ClassNotFoundException: org.apache.commons.lang3.StringEscapeUtils. You need to set up Classpath by setting the dependency to Commons-lang apache. In the case,…
-
8
votes1
answer3583
viewsA: How to apply a style to two different elements using :Hover?
The problem is that it is applying the same rule to two independent selectors, using the "," no relation is created between the selectors. Using the brother selector (General Sibling Selector) "~"…
-
1
votes1
answer522
viewsA: Android: Instagram photos of a particular user
I had the same need as you, access the images of a public profile on Instagram on Android App. But one thing I did differently was create a WebService that from time to time queries the Media API…
-
1
votes1
answer198
viewsA: Only the first checkbox is set from a listview by clicking anywhere in the item
The problem is that inside the OnItemClickListener, is calling the method findViewById of Activity. The findViewById transverse all Views from the root, returning to first found. So the first is…