mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Arg取得 WIP
This commit is contained in:
parent
1aa41eb638
commit
646a97e77b
|
@ -1,15 +1,43 @@
|
|||
package one.nem.lacerta.component.viewer;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.fragment.NavHostFragment;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
import one.nem.lacerta.utils.LacertaLogger;
|
||||
|
||||
@AndroidEntryPoint
|
||||
public class ViewerMainActivity extends AppCompatActivity {
|
||||
|
||||
LacertaLogger logger;
|
||||
|
||||
@Inject
|
||||
public ViewerMainActivity(LacertaLogger logger) {
|
||||
this.logger = logger;
|
||||
logger.debug(TAG, "ViewerMainActivity created");
|
||||
}
|
||||
|
||||
|
||||
// Variables
|
||||
private static final String TAG = "ViewerMainActivity";
|
||||
String documentId;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -20,5 +48,16 @@ public class ViewerMainActivity extends AppCompatActivity {
|
|||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
Intent intent = getIntent();
|
||||
try {
|
||||
documentId = intent.getStringExtra("documentId");
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.error(TAG, "Failed to get documentId from intent");
|
||||
logger.error(TAG, "Searchable Error code: " + "f64c21a2-391f-4c40-92f6-183da459de21");
|
||||
Toast.makeText(this, "Failed to get documentId from intent", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user