Applications – Simple Android calculator that gives wrong results

I just started learning Android app development. As a beginner project, I build a simple calculator app, but every time I execute it, all the other functions besides the addition function will give false results.
Here is the Java code I wrote. (MainActivity.java)

package com.example.calc;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    TextView result; 
    EditText number1, number2;  
    Button add;
    Button sub;
    Button mul;
    Button div;

    public float result_num = 0;
    public int num1;
    public int num2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        result = (TextView) findViewById(R.id.result);

        number1 = (EditText) findViewById(R.id.number1);
        number2 = (EditText) findViewById(R.id.number2);
        //numbers
        add = (Button) findViewById(R.id.add);
        sub = (Button) findViewById(R.id.sub);
        mul = (Button) findViewById(R.id.mul);
        div = (Button) findViewById(R.id.div);

        ///////////Calculation part///////////

        add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                num1 = Integer.parseInt(number1.getText().toString());
                num2 = Integer.parseInt(number2.getText().toString());
                result_num = (num1 + num2);
                result.setText(String.valueOf(result_num));

            }
        });
        sub.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                num1 = Integer.parseInt(number1.getText().toString());
                num2 = Integer.parseInt(number1.getText().toString());
                result_num = (num1 - num2);
                result.setText(String.valueOf(result_num));
            }
        });
        mul.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                num1 = Integer.parseInt(number1.getText().toString());
                num2 = Integer.parseInt(number1.getText().toString());
                result_num = (num1 * num2);
                result.setText(String.valueOf(result_num));
            }
        });
        div.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                num1 = Integer.parseInt(number1.getText().toString());
                num2 = Integer.parseInt(number1.getText().toString());
                result_num = (num1 / num2);
                result.setText(String.valueOf(result_num));
            }
        });
    }
}

The XML code for the app. (Activity_main.xml)

I use a linear layout




    

    

    

    

Please help me.
Thanks.

Is it true that women are perfect and never do anything wrong?

No, no teacher would ever say that. It's too ridiculous, demonstrably wrong.

The reality is that the logic of gender research is far more insidious: Sure, women do things that are wrong, but let's just talk about the things men do to women who are wrong.

That said, you say at the beginning of the lesson that women are not perfect, that women can be evil, etc., etc. – but then spend the rest of the year ignoring this and simply stinging students over and over again threatened by these evil men and that this is the biggest risk they are exposed to.

Wrong address restoration restoration restoration

Hi sorry I sent cash to bitcoin instead of the bitcoin address. Please follow. My account is currently not charged. Instead of this address: 1FJ1sryyHTXza6BDX5o4d4JFUDCdFt9muR I have sent this address to you: qzwvnyrcat3fy0l9r0jcvl82ellnrtuccug82rtd6k This is my Bitcoin address. My Bitcoin address: 1FJ1sryyHTXza6BDX5o4d4JFUDCdFt9muR My Bitcoin money address: qzwvnyrcat3fy0l9r0jcvl82ellnrtuccug82rtd6 Please note that this device is in the Bitcoin money account. I ask you to send money to my Bitcoin address. Bitcoin Back to: 19pRw18fgnC9bj2NbGTwrNPQBw53yMJhmP

google sheets – Wrong and weird results when using COUNTIFs with Arrayformula

I have three functions to check if I have a stock (by seeing that column F is not empty). Then I want to check column AB to determine which market the stock comes from. In the first case, I would like to calculate the number of large cap companies in which I own shares.

However, my formulas seem to recalculate incorrectly. Sometimes they do not change at all when I add new stock to my portfolio. The following three functions are the functions that I use. (Remember, these are European delimiters, so the ";" should not be changed to "," for example.

=COUNTIFs(('ISK Investeringar'!$F$3:$F$103); "<>" ; ArrayFormula(vlookup(('ISK Investeringar'!$F$3:$F$103);sort({'ISK Investeringar'!$F$3:$F$103'ISK Investeringar'!$AB$3:$AB$103};2;false);2;false)); "Large Cap" )/D3

=(COUNTIFs(('ISK Investeringar'!$F$3:$F$103); "<>" ; ArrayFormula(vlookup(('ISK Investeringar'!$F$3:$F$103);sort({'ISK Investeringar'!$F$3:$F$103'ISK Investeringar'!$AB$3:$AB$103};2;false);2;false)); "Mid Cap") + COUNTIFs(('ISK Investeringar'!$F$3:$F$103); "<>" ; ArrayFormula(vlookup(('ISK Investeringar'!$F$3:$F$103);sort({'ISK Investeringar'!$F$3:$F$103'ISK Investeringar'!$AB$3:$AB$103};2;false);2;false)); "Small Cap"))/D3

=COUNTIFs(('ISK Investeringar'!$F$3:$F$103); "<>" ; ArrayFormula(vlookup(('ISK Investeringar'!$F$3:$F$103);sort({'ISK Investeringar'!$F$3:$F$103'ISK Investeringar'!$AB$3:$AB$103};2;false);2;false)); "First North" )/D3

With these 3 formulas and for example with 7 different stocks in the following markets:

Big cap
Big cap
Big cap
Big cap
ETF
Mid cap
First north

I get the following percentages:
71% large cap
14% mid cap
0% First North

Can anyone see what's wrong in this formula for the purpose described above? I have the same formula to see in how many different industries I own companies, and this feature works perfectly. I will share this feature below:

=COUNTIFs( UNIQUE('ISK Investeringar'!$C$3:$C$103); "<>"; ArrayFormula(vlookup(unique('ISK Investeringar'!$C$3:$C$103);sort({'ISK Investeringar'!$C$3:$C$103'ISK Investeringar'!$F$3:$F$103};2;false);2;false)); "<>" )

I'd like to know why my first 3 formulas do not work properly, but the last one.

thank you in advance