Posts by ramaral • 44,197 points
1,060 posts
-
5
votes1
answer148
viewsA: How do I start Maps in a specific place?
Use googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LatLng, ZoomLevel)); to position the camera at the zoom level ZoomLevelat the location represented by the coordinates LatLng: private void…
-
0
votes2
answers127
viewsA: Click button performs an action second click on the same button performs different action
If what you want is for the button to change the visibility of the view in each click, alternate from visible to invisible can do so: myButton.setOnClickListener(new OnClickListener(){ public void…
-
1
votes2
answers758
viewsA: Update layout from a button
Your problem exists because you are putting all the logic of your application into a method whose function is just to create the View of Fragment. I suggest you do so: Declare all variables…
-
7
votes2
answers29746
viewsA: How to pass data from one table to another SQL
If the second table already exists use INSERT INTO SELECT If both tables have the same fields: INSERT INTO table2 SELECT * FROM table1; If only some fields are common, you will need to specify these…
-
0
votes2
answers1001
viewsA: Focus on open window
If I understand util.Funcoes.is_open_window == 1 indicates that the window is open. So add a else to your condition and make the window receive the phocus: Usuario_Consultar frmGo = new…
-
2
votes2
answers335
viewsA: Inheritance and manipulation of a superclass’s methods
What I think you want in this case has nothing to do with inheritance. What you want is to use class Summing up, for this it is necessary to create an instance of it with the operator new, as you…
-
2
votes2
answers457
views -
4
votes1
answer985
viewsA: Error when converting String to Jsonobject
org.json.JSONException: No value for success This line in the Logcat indicates that the value of successis void. When it is assigned to the variable success in int success =…
-
1
votes1
answer256
viewsA: Is Generic stabbing possible?
For what I see in the code the class DaoFacadeis a generic class, or is prepared for what you want. By instantiating it you indicate which class it will use. Your builder will be something like:…
-
4
votes2
answers5290
viewsA: How to use onActivityResult when there is more than one startActivityForResult
There can only be one method onActivityResult() in each Activity. This method is called after each call to startActivityForResult. When calling the method startActivityForResult is passed, in the…
-
1
votes1
answer58
viewsA: How to view date ranges from another table?
There’s nothing complicated about it: Select data1, data2, SUM(valor_vendas) as vendas_periodo From datas_periodos, vendas Where data_venda Between data1 and data2 Group by data1 See on Sqlfiddle…
-
4
votes3
answers8270
viewsA: Convert natural number to binary recursively
If the intention is just to do the display of each digit you can use this: #include <iostream> #include <stdio.h> using namespace std; void ConvertToBinary(int n); int main() {…
-
1
votes2
answers503
viewsA: Use ON CASCADE DELETE in SQL
If you want there to be a relationship Many-to-Many amid Diagnosis and Sick it is necessary to define another table to represent that relation. This table should have 2 fields one to store the…
-
2
votes1
answer7900
viewsA: Query using between with sql server 2005
The problem is you’re comparing the type Date with the guy Datetime. The second parameter in terms of Datetime, is regarded as 04/02/2015 00:00:00.000, which is the beginning of the day. So that the…
-
2
votes1
answer516
viewsA: Android - Different ways of "setar" a system in objects
It is also possible to assign the clickEvent in the xml: <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="OK" android:onClick="onClick" /> In the…
-
4
votes2
answers1943
viewsA: Updating Listview when I come back from a screen
If I understand your problem, you must pass the call to refreshLista(); for the method onResume of Activity: public class ListReceitaActivity extends ActionBarActivity { @Override protected void…
-
14
votes1
answer693
viewsA: How to discover the mobile operator of Android?
Android provides the class Telephonymanager providing access to information relating to the telephone service. It has methods that allow access to some types of subscriber information. Among them is…
-
7
votes2
answers4640
viewsA: Code to check if GPS is active
To know if the GPS is on use this code: LocationManager manager = (LocationManager) getSystemService( Context.LOCATION_SERVICE ); bool isOn = manager.isProviderEnabled(…
-
9
votes1
answer1441
viewsA: How to blink button on Android.
Use a Animation to that effect private Animation animation; private Button btn; public void onCreate(Bundle savedInstanceState) { animation = new AlphaAnimation(1, 0); // Altera alpha de visível a…
-
6
votes3
answers2210
viewsA: Remove First Word from String
Utilize indexOf(String str) and delete(int start, int end) StringBuffer sb = new StringBuffer("Palavra1 Palavra2"); int index = sb.indexOf(" "); sb.delete(0, index + 1);//+1 para remover também o…
-
7
votes2
answers6768
viewsA: Run something after inserting a certain number of characters in an Edittext?
To do something at the time anything is typed in Edittext add a TextChangedListener to that Edittext editText.addTextChangedListener(new TextWatcher() { @Override public void…
-
5
votes3
answers6396
viewsA: How to display an image on the screen
In the Layout of your Activity must declare a ImageView If you want it to be only visible after pressing a button you should include the attribute android:visibility="invisible" <ImageView…
-
2
votes2
answers153
viewsQ: Alternative to the use of new when implementing methods that return this in child classes
Taking the example of the following code: public class Pai { protected string PropriedadeA { get; set; } public Pai Metodo1(int valor) { //Vários procedimentos feitos aqui PropriedadeA = "Resultado…
-
2
votes1
answer417
views -
5
votes2
answers665
viewsA: How to send calculation performed in a Service for Activity?
Adapted from android documentation If your service is only used by your application and runs in the same process as the Activity, do the following: In your service implement a Binder. This class…
-
2
votes1
answer1653
viewsA: Resize Images from Camera
I don’t understand why the larger images aren’t shown. I use this function to resize images: private static Bitmap resizeImage(Context context, Bitmap bmpOriginal, float newWidth, float newWeight) {…
-
2
votes1
answer646
viewsA: Assign Listbox values in vector
Is this what you want: foreach (var item in listBox_Nfe.Items) <==== corre listBox { int j = 0; notas[j] = item.ToString(); MessageBox.Show(notas[j]); j++; } The information you give isn’t much,…
-
3
votes1
answer1195
viewsA: Error when another class calls an Activity method
The class Monitoramento is a Activity, cannot be instantiated in the normal way, using new, but through context.startActivity for the entire creation process to be carried out. That’s why…
-
3
votes1
answer2476
viewsA: Photo taken by camera returns reversed
Depending on the cell phone camera drive this rotates the photo before recording or stores the value of the rotation in the TAG_ORIENTATION. So, in order for our program to display the photo…
-
1
votes1
answer166
viewsA: Group Textviews and then access them
You can use a HashMap to guard the TextView, using as key the id: Map<Integer,TextView> map = new HashMap<Integer, TextView>(); map.put(tv1.getId(), tv1); map.put(tv2.getId(), tv2);…
-
4
votes2
answers157
viewsQ: Why are some "git" commands preceded by a dash and others by two dashes?
I’m learning to use the git and I noticed that certain parameters are preceded by a dash while others are preceded by two. Example: git branch --merged git branch -d nome Why?…
-
7
votes2
answers210
viewsA: How to detect USB connection via application?
In the Activity that has this menu do the following: Declare a class derived from BroadcastReceiver public class UsbDeviceDetect extends BroadcastReceiver { @Override public void onReceive(Context…
-
3
votes3
answers861
viewsA: Time Count For Move (Threads)
Using the class Task it’s easy to do what you want: class Program { static void Main(string[] args) { String str = null; //Objectos que permitem cancelar as Tasks var tokenSourceTempo = new…
-
3
votes1
answer348
views -
2
votes2
answers548
viewsA: Pass String array by parameter to tela2
Instead of using a String with values separated by comma, use a Arraylist and pass it using intent.putStringArrayListExtra(): listaEstados = new String[]{"São Paulo", "Rio de Janeiro", "Minas…
-
4
votes2
answers2322
viewsA: How to save/recover image in memory on android?
Let’s first write a method that checks the existence of Sdcard and whether it is possible to write on it: public boolean isExternalStorageWritable() { String state =…
-
5
votes2
answers814
viewsA: SQL function that applies to each row of the column
SQL SERVER Use the function DATEPART() If the field Date of your table for minhaData can use such a SELECT to separate that date into day/month/year.: SELECT DATEPART(yyyy,minhaData) AS ano,…
-
2
votes1
answer63
viewsA: Differentiate View accessed by a reused Contextmenu in multiple Views
In the method onCreateContextMenu is passed to view that requested the creation of the menu thus, depending on that view, you can initialize a variable that will indicate which image was clicked.…
-
3
votes1
answer738
viewsA: Change the visibility of a layout’s fields at runtime
Do not use values explicitly when there are constants defined for this purpose. The class View declares the following constants to be used in the method setVisibility(), to define its visibility:…
-
3
votes1
answer759
viewsA: SQLITE cursor picking up last value
There are several ways to get the values of a clicked line listView, one of them is through the view which is spent in onItemClick: listview.setOnItemClickListener(new…
-
2
votes3
answers698
viewsA: Unit tests with Nunit
I don’t know him very well Nunit but looking at your code I highlight two things: 1 - You are used the annotation [TesteCase] no parameters, so the method does not receive any values. 2 - You…
-
3
votes1
answer422
viewsA: WPF window does not exceed the screen
One hypothesis is, in this case, the mouse coordinates do not set the upper left corner of the window but the upper right corner. The same can be done if the window does not fit vertically, instead…
-
8
votes4
answers164
viewsA: Father class with the same responsibility of the daughter class
I don’t know what the purpose of class but, just from your code, I think this is enough: public class Item { public string Nome {get;set;} public decimal Valor {get;set;} public…
-
8
votes1
answer86
viewsA: Instruction throw is making the system inconsistent
Use of the instruction throw alone inside the block catch() causes the captured exception to be re-launched, has the same effect as there was no block try/catch If there is any inconsistency in the…
-
3
votes2
answers717
viewsA: Receive variable value without passing parameter
Define an extension method (Extension Method) to the string class: public static string toCamelCase(this string text) { text = string.Format("{0}{1}",text.Substring(0,…
-
2
votes1
answer251
viewsA: How to get the main color of an Imageview?
To get the color of a given pixel of a Imageview use the method getPixel of Bitmap associated with Imageview. Code to get center pixel color: Bitmap…
-
1
votes3
answers729
viewsA: Print vector data in a struct
data_aniversario is a array with 4 elements data. You do the input of 4 dates and save in this array. To print you will need to use a loop that goes through all the elements of data_aniversario.…
-
4
votes1
answer92
viewsA: Manipulating buttons on list items
Your Adapter sounds good to me. The problem is in the use of itemSuporte. Note that the itemSuporte is used whenever a line listView needs to be designed. At the end of the entire list will be…
-
6
votes5
answers2700
viewsA: Drawing strings from a weight array
I would make the choice in two stages: 1 - Draw a value between 1 and the number of inhabitants of the most populous city. 2 - Draw the city from among those who have a number of inhabitants equal…
-
2
votes1
answer335
viewsA: How to paint a cell from a Datagrid?
The problem you refer to while doing scroll has to do with how the visual elements of the Datagrid are managed. The objects Datagridrow, Datagridcell etc, are created and discarded depending on…