make no crashout
This commit is contained in:
commit
56a8d17403
@ -1,14 +1,12 @@
|
|||||||
package com.example.scoutingapp;
|
package com.example.scoutingapp;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
import androidx.activity.EdgeToEdge;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@ -61,13 +59,12 @@ public class EndActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button Delete = (Button) findViewById(R.id.deleteButton);
|
Button Sheet = (Button) findViewById(R.id.Sheet);
|
||||||
Delete.setOnClickListener(new View.OnClickListener() {
|
Sheet.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Submit submit = new Submit();
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://docs.google.com/spreadsheets/d/1ky5LBTpnEeBEEaaF7z6UWdh-E7YmOSeij4dYdR2PU4A/edit?gid=0#gid=0"));
|
||||||
//Deletes the CSV file (Currently for testing but feature might stay but with some features to make it harder to do it on accident)
|
startActivity(browserIntent);
|
||||||
submit.deleteCSVFile(EndActivity.this);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ public class Submit {
|
|||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
Log.d("GoogleSheets", "Data uploaded to Google Sheets successfully.");
|
Log.d("GoogleSheets", "Data uploaded to Google Sheets successfully.");
|
||||||
|
deleteCSVFile(context);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("GoogleSheets", "Error uploading data", e);
|
Log.d("GoogleSheets", "Error uploading data", e);
|
||||||
renameFile(context, csvFileString);
|
renameFile(context, csvFileString);
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/deleteButton"
|
android:id="@+id/Sheet"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Delete old data"
|
android:text="The Google Sheet"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user