Made a way to open google sheet and fixed the upload
This commit is contained in:
parent
62a97001ac
commit
f3297756eb
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user