Posts by Marceloawq • 971 points
82 posts
-
0
votes1
answer24
viewsA: How to check if a phrase/string contains words from a list in Kotlin
What you’re doing makes no sense. What you have to do is use the method contains to check if a word exists in a string. For example: fun main() { val cores = listOf( "branco", "azul", "verde" ) val…
-
0
votes1
answer46
viewsQ: Map a property to Enum
I’m starting automapper studies so I don’t even know if I’m using the correct terms to ask the question, but here’s the thing. I have the class Patient that, among other properties, has an Enum…
-
2
votes2
answers46
viewsQ: Enum initialization
I’ve always created enums thus: public enum TipoTelefone { Residencial, Celular, Comercial } But today giving maintenance on a code I found one like this: public enum TipoTelefone { Residencial = 0,…
-
2
votes1
answer37
viewsQ: Substring does not return empty string
I have the following text file called fullResponse <Sum> [stat]player_ammo_restored = 3447 <Sum> [stat]player_climb_assists = 2102 <Sum> [stat]player_climb_coops = 2612 <Sum>…
-
0
votes0
answers6
viewsQ: Custom spinner not correct image arrow
I have a custom spinner, I am correctly assigning the name, but the image is repeating in all items on the list. class Server(val context: Context, var servers: Array<ServerCode>) :…
-
2
votes1
answer42
viewsQ: Filtering a list with elements contained in another list
I have the class class estruturaPosicaoXY(val x: Float, val y: Float) {} then fill out a list of that class through the method: fun mapearXY(x: Float, y: Float): List<estruturaPosicaoXY> { val…
-
1
votes1
answer86
viewsA: Select with two context in entityframework
Yes, for each context you need to bring a list, and only then do the comparisons; If I had all the attributes of these classes, I could do a better query, with what was given, I would look like…
-
0
votes1
answer55
viewsQ: Dynamically pick up color
I created some colors in the file colors.xml <color name="colorBackground1">#5c6bc0</color> <color name="colorBackground2">#1e88e5 </color> <color…
-
10
votes3
answers184
viewsQ: Differences in the method call
Why some methods can be called consecutively, example: string a = ""; a.Replace("a", "b").Replace("b","c");// o replace foi chamado 2x And others cannot be called the same? ClasseA A = new…
c#asked Marceloawq 971 -
0
votes1
answer80
viewsA: Change Mainactivity for another by clicking a Switch button and keeping the change
Of the many possible ways, I would use SharedPreferences. Check your switch button and save which type you want to keep through preferences. Switch swt = findViewById(R.id.swt); if (swt.isChecked())…
androidanswered Marceloawq 971 -
0
votes1
answer32
viewsQ: Link in a Nsattributedstring
I have a string that is actually a snippet in HTML. I use the following method to convert this snippet into a string and set it in label let s = Descricao.data(using: String.Encoding.unicode)! let…
swiftasked Marceloawq 971 -
0
votes2
answers56
viewsA: Android change the color of a button for 1second
You can set the color you want and then use a handler to set another color after 1 second: Button btn_1 = findViewById(R.id.btn_1);…
-
0
votes1
answer43
viewsA: Code generation shortcut
The name of this is Live Templates(fyk, in visual studio is snippets). To see/edit/add your live templates, go to Files > Settings > Editor > Live Templates choose what you want(android,…
android-studioanswered Marceloawq 971 -
0
votes2
answers51
viewsA: Save data from a Row to an array
Create an array of the type you are using in the datasource. To get the type just give a cast. MeuObjeto oObjeto = (MeuObjeto)gvDados.GetRow(i); Then fill the array with these objects.…
-
0
votes1
answer151
viewsA: Listview with JSON + PHP
To display these three data, create an object and fill it with this return of your php code. public class MeuObjeto { private String Contrato, Tipo, Horario; } Next, create a list of these objects;…
-
1
votes2
answers73
viewsA: how do I stop a sum?
You didn’t initialize yours EditText; You stated public EditText txtSoma; but needs to initialize. For example: txtSoma = findviewbyid(R.id.txtSoma);…
-
1
votes2
answers277
viewsA: Recover information from a sharedPreference Android
As you want to use it in several places, you can create a static method that returns the string you want. Create a class and create this static method within it. public class Preferencias_Usuario {…
androidanswered Marceloawq 971 -
-1
votes3
answers218
viewsA: Public field X property
Within the class you declared no matter if you are string nome; or string Nome { get; set; }. It’s the same. In the first way, the get/set is implicit, but it’s still there. If you take the set, she…
-
1
votes2
answers441
viewsA: Error 1 No Overload for method 'Inherited method' takes 1 Arguments
Along those lines codigo = this.conexaoBanco.proximoCodigo(this.tabela) You are calling the method by passing 1 parameter (this.tabela) And as the error says, your method expects two strings public…
-
0
votes1
answer262
viewsQ: Request error with complex object
I’m trying to file a requisition for a webservice. Note that by Soapui it works normally But by android passing exactly the same data The following error occurs: SoapFault - faultcode: 'soap:Client'…
-
1
votes1
answer1541
viewsA: How to open an Activity via a button
It’s no secret, you can do it inside the onClick straightforward. button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new…
-
0
votes0
answers37
viewsQ: Remove Fixed lenght from SQL Server
The string fields of the tables in my database are coming with Fixed length as true. So if the size is 60, and I save a string with a size of 30, it fills the string with spaces up to the full size.…
-
2
votes0
answers101
viewsQ: Unexpected end of stream
I’m consuming a webservice on android. But I’m having trouble with the following method: public static SoapObject Retornar_Lista_UFs(int pCodigo_Entidade) { Financeiro_NG oFinanceiro = new…
-
0
votes2
answers124
viewsQ: Tablayout under the actionbar
I’ll use a tablouyt but it sits under the action bar, how to solve this? Xml of the screen <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.TabLayout…
androidasked Marceloawq 971 -
1
votes0
answers21
viewsQ: Progressiring is not shown
I need to show the progressringduring the execution of a task, but it does not appear and the screen is frozen until the execution of the task. private async void btn_Criar_Click(object sender,…
-
0
votes3
answers169
viewsA: How do I identify the method or command in the code to display a data list in Navigationview?
In this passage mainActivity = (DrawerLayout) findViewById(R.id.mainActivity); drawView = (DrawView) findViewById(R.id.drawview); drawView.initWindowSize(); ActionBarDrawerToggle toggle = new…
-
3
votes1
answer370
viewsA: Create a pdf on android
Solved in a simple way. The Code was practically right, all that was missing was Code for Base64. I added this line after picking up the byte[] from the previous Activity byte[] decodedString =…
-
1
votes1
answer370
viewsQ: Create a pdf on android
I have a byte[] which is a pdf. use the following class to try to convert it. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes1
answer74
viewsQ: Shared preferences saving whole wrong
I am saving the user code (an integer) in Shared preferences: String a = Integer.toString(pUsuario.getCodigo()); SharedPreferences.Editor editor_Codigo = oCodigo.edit();…
-
0
votes1
answer24
viewsQ: Where on the list with recyclerview
I need to get the position of an item in the list, where the code is what I passed. In C# I do this like Python, how to do in java? public void onBindViewHolder(final LineHolder_Entidade holder,…
-
0
votes1
answer198
viewsQ: Recycler view com async task
I have the class of my Activity public class Convenio_Conselho_Listar_TL extends AppCompatActivity { public List<Convenio_Conselho_Grid_BD> oConvenios; RecyclerView mRecyclerView; private…
-
0
votes1
answer114
viewsA: Cast in a Soapobject
The solution was to change the return type of the method to SoapObject public SoapObject Pesquisar_Convenios(int pCodigo_Entidade) { SoapObject request = new…
-
1
votes1
answer114
viewsQ: Cast in a Soapobject
I have the following code to consume one WebService: public List<Convenio_Conselho_Grid_BD> Pesquisar_Convenios(int pCodigo_Entidade) { SoapObject request = new…
-
0
votes3
answers78
viewsA: Mensagebox is in loop
Once you enter the event disables it, before leaving active again. private void Destino_Leave(object sender, EventArgs e) { //desativando o evento destino.Leave -= Destino_Leave; if (!Encerrar) { if…
-
1
votes1
answer42
viewsQ: Listview is showing nothing
I have the class answer public class Resposta { private String Nome; private boolean Certo_Errado; public Resposta(String nome, boolean certo_Errado) { Nome = nome; Certo_Errado = certo_Errado; }…
-
0
votes2
answers284
viewsA: Convert number c#
Use the following method public static decimal Sem_Simbolo(string pValor_Reais) { return Convert.ToDecimal(pValor_Reais.Replace("R$", string.Empty)); } Or convert straight, whatever. But it will…
-
2
votes3
answers262
viewsA: How to access Form1 members from Form2?
The easiest way to do it is to Create a form1change the color of the panel. Then create a property on form2 who receives the form1 and pass the form1 when opening the form2 So, when opening the…
c#answered Marceloawq 971 -
0
votes1
answer520
viewsQ: html2canvas Image in div
I have the following div <div class="jumbotron" ng-app> <div class="row"> <div class="col-md-4"> <input type="text" ng-model="yourName" placeholder="Seu nome"> <br />…
html2canvasasked Marceloawq 971 -
0
votes1
answer895
viewsA: Firebase for a List
I figured it out by doing this. I removed Child from Wallpapers DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("Wallpapers"); And I did a foreach on each Datasnapshot…
-
0
votes1
answer895
viewsQ: Firebase for a List
I need to take all the data from firebase and create a list, to use in a listadaper that I created. This is the structure of the Bank in Firebase: As you can see, I want to get all the child…
-
0
votes1
answer110
viewsQ: Project preview in android studio
Why has the visualization of my project items in android studio changed? Only this project is like this, the others are normal.…
-
1
votes2
answers427
viewsA: Doubt simple back web view
You will have to override some back button method, I would recommend the onBackPressed, but I also found this reply in the English OS showing a overridein the keydown It would look something like…
-
1
votes0
answers205
viewsQ: Label on a button
How to add a label to a button, as in the image? By clicking this button, this label Just to let you know there’s something new on the menu. how to do something similar?…
-
0
votes3
answers232
viewsA: Difference on screen Windows Forms C#
Usually you putting 6-8 wide panels on the edges avoids this kind of problem.
-
0
votes0
answers43
viewsQ: Toast if a component gains focus
I want to display a Toast if the map view gains focus. What I’ve been able to do so far is: mapView.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void…
-
0
votes1
answer668
viewsA: An imageview receive image according to the selected option
Arrow one onClickListener on each button. When entering this method, arrow the image. For example, in the onClickListener of button 1: btn1.setOnClickListener(new View.OnClickListener() { @Override…
-
0
votes0
answers19
viewsQ: Waiting for a page to load
I have a home page, and when I click a button, I navigate to the next page. The problem is that this page does a database query and returns many records, which are inserted in 3 listviews different.…
-
1
votes4
answers1125
viewsA: Loading an externally created Sqlite database
First, in your build.gradle (module:app) Add the following line: compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' It’ll help us connect to the bank. Sync your Radle after this. Then,…
-
0
votes0
answers140
viewsQ: Query with special characters in an Observablecollection
I created a search method that receives a text, and searches that text in a ObservableCollection pre-filled. private void btn_Pesquisar_Click(object sender, RoutedEventArgs e) {…
-
0
votes2
answers485
viewsA: How can I call a class void method to display an msg in a form
The way you’re talking, I think it would be the other way around, the way would be to call the method and run the call from MessageBox() within that method.