stuck CSEntry app with intent

Discussions about creating CAPI applications to run on Android devices
Post Reply
amari
Posts: 22
Joined: February 24th, 2024, 11:29 am

stuck CSEntry app with intent

Post by amari »

When dynamically passing keys via an intent from an Android app to CSEntry in Android, I encounter an issue when attempting to open the CSEntry app repeatedly for different cases. After each attempt, without accepting the case (uncompleted data entry. user just close app by using android keys), I receive an 'Application Startup Error' stating that CSEntry could not open the 'name' of the app (.pen).

This code is working if I softly handle only one case,but I have to call pff with different keys repeatedly, for each cases.and user may escape without completing case.

I utilize the following code to open the app by passing 'var1' (for demonstration purposes):

String var1 = etext.getText().toString();
Intent intent = new Intent();
intent.setComponent(new ComponentName("gov.census.cspro.csentry", "gov.census.cspro.csentry.ui.EntryActivity"));
intent.putExtra("PffFilename", "test.pff");
intent.putExtra("OperatorID", "John Doe");
intent.putExtra("StartMode", "add");
intent.putExtra("variable", var1);
startActivity(intent);

Upon experimenting, I observed that when I attempt to run the app within CSEntry itself (by that time), I encounter a message stating 'CSEntry is already running another application. You can only run one application at a time.' It appears as though the app is hidden in the background.
to resolve I need to reinstall app. I use onStop() with stop(1) hoping to terminate app but no luck. any suggestion pls
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: stuck CSEntry app with intent

Post by Gregory Martin »

It's true that only one instance of EntryActivity can be open at a time. When you say that they are closing the application by using Android keys, are you saying that they are going back to the Android home screen and then reentering your application? If they use the back button from within CSEntry, it should go back to your application and close EntryActivity. If they're going to the home screen, then EntryActivity will stay active.

If it's the latter action, then we'll have to research ways to handle this.
Post Reply