App is crashing at startup? Any idea? Thanks!
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;
import java.util.ArrayList;
import java.util.Random;
public class MainActivity extends AppCompatActivity {
private EditText teamOneText;
private EditText teamTwoText;
private Button selectButton;
private TextView resultView;
Random r = new Random();
ArrayList<EditText> editTextList = new ArrayList<>();
ArrayList<String> editTextValues = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editTextList.add(teamOneText);
editTextList.add(teamTwoText);
for(int i=0;i<editTextList.size();i++){
editTextValues.add(editTextList.get(i).getText().toString());
}
teamOneText = findViewById(R.id.team_one);
teamTwoText = findViewById(R.id.team_two);
resultView = findViewById(R.id.result_view);
selectButton = findViewById(R.id.select_button);
selectButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
resultView.setText(editTextValues.get(r.nextInt(editTextValues.size())));
}
});
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/result_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result shown here"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.70" />
<Button
android:id="@+id/select_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Random Team"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.40" />
<EditText
android:id="@+id/team_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="Team's name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.70"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.15" />
<EditText
android:id="@+id/team_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:text="Team's name"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.70"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.25" />
<TextView
android:id="@+id/team1_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Team 1"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.16" />
<TextView
android:id="@+id/team2_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Team 2"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.26" />
</androidx.constraintlayout.widget.ConstraintLayout>
strings.xml
<resources>
<string name="app_name">TeamSelector</string>
</resources>
In: Computer Science
Complete the Table by Choosing one of the following options to analyse each Transaction of Ben Bicycle Traders for February 2020
Yes – Debit entry
Yes- Credit Entry
No Entry
|
Transaction: |
General Journal |
Bank account (General Ledger) |
Bank Reconciliation Statement |
A comparison of the Bank Statement of Bicycle Traders for February 2020 with the Bank reconciliation Statement at 31 January 2020, and the Cash Reports for February 2020, revealed the following:
In: Accounting
Presented here are summarized data from the balance sheets and income statements of Wiper Inc.:
| WIPER INC. | |||||||||
| Condensed Balance Sheets | |||||||||
| December 31, 2020, 2019, 2018 | |||||||||
| (in millions) | |||||||||
| 2020 | 2019 | 2018 | |||||||
| Current assets | $ | 734 | $ | 959 | $ | 813 | |||
| Other assets | 2,421 | 1,928 | 1,727 | ||||||
| Total assets | $ | 3,155 | $ | 2,887 | $ | 2,540 | |||
| Current liabilities | $ | 585 | $ | 838 | $ | 731 | |||
| Long-term liabilities | 1,555 | 1,015 | 883 | ||||||
| Stockholders’ equity | 1,015 | 1,034 | 926 | ||||||
| Total liabilities and stockholders' equity | $ | 3,155 | $ | 2,887 | $ | 2,540 | |||
| WIPER INC. | ||||||
| Selected Income Statement and Other Data | ||||||
| For the year Ended December 31, 2020 and 2019 | ||||||
|
(in millions) |
||||||
| 2020 | 2019 | |||||
| Income statement data: | ||||||
| Sales | $ | 3,058 | $ | 2,921 | ||
| Operating income | 304 | 318 | ||||
| Interest expense | 92 | 73 | ||||
| Net income | 215 | 210 | ||||
| Other data: | ||||||
| Average number of common shares outstanding | 42.1 | 47.5 | ||||
| Total dividends paid | $ | 58.0 | $ | 53.1 | ||
Required:
In: Accounting
In: Accounting
Carla Corporation has one temporary difference at the end of 2020
that will reverse and cause taxable amounts of $57,000 in 2021,
$61,800 in 2022, and $67,300 in 2023. Carla’s pretax financial
income for 2020 is $286,600, and the tax rate is 30% for all years.
There are no deferred taxes at the beginning of 2020.
Compute taxable income and income taxes payable for
2020.
|
Taxable income |
$enter a dollar amount | |
|---|---|---|
|
Income taxes payable |
Prepare the journal entry to record income tax expense, deferred income taxes, and income taxes payable for 2020
Prepare the income tax expense section of the income statement for 2020, beginning with the line “Income before income taxes.”.
In: Accounting
On January 1, 2020, The Fio Corporation purchased a machine for $600,000. The corporation estimated a 5-year useful life (or 300,000 units of useful life) and $60,000 residual/salvage value.
45000 Units were produced in 2020.
6 points:
Complete the following table using the indicated depreciation method and year for each row of the table.
|
Method |
Depreciation expense |
Accumulated depreciation |
Book value |
|
|
Straight-line for 2020 |
||||
|
Double-declining balance 2020 |
||||
|
Double-declining balance 2021 |
||||
|
Units-of-production 2020 |
|
|
|
|
4 points:
What would the journal entry be if the straight-line method was used and the machine was sold on 12/31/2020 for $500,000?
In: Accounting
Pronghorn Co. provides the following information about its
postretirement benefit plan for the year 2020.
| Service cost | $87,700 | ||
| Prior service cost amortization | 3,200 | ||
| Contribution to the plan | 60,500 | ||
| Actual and expected return on plan assets | 62,100 | ||
| Benefits paid | 39,000 | ||
| Plan assets at January 1, 2020 | 704,000 | ||
| Accumulated postretirement benefit obligation at January 1, 2020 | 763,900 | ||
| Accumulated OCI (PSC) at January 1, 2020 | 101,900 | Dr. | |
| Discount rate | 9 | % |
Prepare a worksheet inserting January 1, 2020, balances, showing
December 31, 2020, balances, and the journal entry recording
postretirement benefit expense. (Enter all amounts as
positive.)
In: Accounting
In: Accounting
The following information is available for Ivanhoe Company. 1. Purchased a copyright on January 1, 2020 for $62,400. It is estimated to have a 10-year life. 2. On July 1, 2020, legal fees for successful defense of the copyright purchased on January 1, 2020, were $17,784.
Prepare the journal entries to record all the events related to
the copyright during 2020. (Credit account titles are
automatically indented when the amount is entered. Do not indent
manually.)
Jan 1st 2020, July 1st, 2020, Dec 31st, 2020
At December 31, 2021, an impairment test is performed on the
copyright purchased in 2020.
It is estimated that the net cash flows to be received from the
copyright will be $62,400, and its fair value is $59,280. The
accumulated amortization at the end of 2021 was $15,288. Compute
the amount of impairment, if any, to be recorded on December 31,
2021. (If there is a loss on impairment, then enter
amounts using either a negative sign preceding the number e.g. -45
or parentheses e.g. (45).)
| Amount of impairment | $ |
In: Accounting
Purple Co. began business on January 1, 2020. The following items caused the only differences between pretax financial income and taxable income.
Tax Depreciation
2020 2021 2022 2023 Total
$360,000 $180,000 $140,000 $120,000 $800,000
The enacted tax rates existing at December 31, 2021 are:
2020 20% 2022 30%
2021 20% 2023 30%
2024 30%
Instructions:
1): 2): 3): 4):
Purple’s taxable income for 2020 was $900,000. Prepare the journal entry to record income tax expense, deferred taxes, and the income taxes payable for 2020. Show your work.
In: Accounting