AnalysisActivity

Screen API

When you use the Screen API, the {@code AnalysisActivity} displays the captured or imported document and an activity indicator while the document is being analyzed by the Gini API.

Note: The title from the ActionBar was removed. Use the activity indicator message instead by overriding the string resource named {@code gv_analysis_activity_indicator_message} . The message is displayed for images only.

For PDF documents the first page is shown (only on Android 5.0 Lollipop and newer) along with the PDF's filename and number of pages above the page. On Android KitKat and older only the PDF's filename is shown with the preview area left empty.

Extending the {@code AnalysisActivity} in your application has been deprecated. The preferred way of adding network calls to the Gini Vision Library is by creating a GiniVision instance with a and a GiniVisionNetworkApi implementation.

Note: When declaring your {@code AnalysisActivity} subclass in the {@code * AndroidManifest.xml} you should set the theme to the {@code GiniVisionTheme} . If you would like to use your own theme please consider that {@code AnalysisActivity} extends AppCompatActivity and requires an AppCompat Theme.

The {@code AnalysisActivity} is started by the CameraActivity after the user has reviewed the document and either made no changes to the document and it hasn't been analyzed before tapping the Next button, or the user has modified the document, e.g. by rotating it.

For imported documents that cannot be reviewed, like PDFs, the CameraActivity starts the {@code AnalysisActivity} directly.

If you didn't create GiniVision instance you have to implement the following methods in your {@code AnalysisActivity} subclass:

  • onAnalyzeDocument - start analyzing the document by sending it to the Gini API.Note: Call onDocumentAnalyzed when the analysis is done and the Activity hasn't been stopped.Note: If an analysis error message was set in the Review Screen with this method won't be called until the user clicks the retry button next to the error message.
  • onAddDataToResult - you should add the results of the analysis to the Intent as extras and retrieve them once the CameraActivity returns.This is called only if you called before.When this is called, control is returned to your Activity which started the and you can extract the results of the analysis.

You can also override the following method:

  • - called when the back or the up button was clicked.
Customizing the Analysis Screen Customizing the look of the Analysis Screen is done via overriding of app resources.

The following items are customizable:

  • Activity indicator color: via the color resource named {@code * gv_analysis_activity_indicator}
  • Activity indicator message: via the string resource named {@code * gv_analysis_activity_indicator_message}
  • Activity indicator message text style: via overriding the style named {@code * GiniVisionTheme.Analysis.AnalysingMessage.TextStyle}
  • Activity indicator message font: via overriding the style named {@code * GiniVisionTheme.Analysis.AnalysingMessage.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code assets} folder
  • PDF info panel background: via the color resource named {@code * gv_analysis_pdf_info_background}
  • PDF filename text style: via overriding the style named {@code * GiniVisionTheme.Analysis.PdfFilename.TextStyle} and setting an item named {@code android:textStyle} to {@code normal} , {@code bold} or {@code italic}
  • PDF filename text size: via overriding the style named {@code * GiniVisionTheme.Analysis.PdfFilename.TextStyle} and setting an item named {@code autoSizeMaxTextSize} and {@code autoSizeMinTextSize} to the desired maximum and minimum {@code sp} sizes
  • PDF filename text color: via the color resource named {@code * gv_analysis_pdf_info_text}
  • PDF filename font: via overriding the style named {@code * GiniVisionTheme.Analysis.PdfFilename.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code assets} folder
  • PDF page count text style: via overriding the style named {@code * GiniVisionTheme.Analysis.PdfPageCount.TextStyle} and setting an item named {@code android:textStyle} to {@code normal} , {@code bold} or {@code italic}
  • PDF page count text size: via overriding the style named {@code * GiniVisionTheme.Analysis.PdfPageCount.TextStyle} and setting an item named {@code android:textSize} to the desired {@code sp} size
  • PDF page count text color: via the color resource named {@code * gv_analysis_pdf_info_text}
  • PDF page count font: via overriding the style named {@code * GiniVisionTheme.Analysis.PdfPageCount.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code assets} folder
  • Background color: via the color resource named {@code gv_background} . Note: this color resource is global to all Activities ( CameraActivity , OnboardingActivity , ReviewActivity , )
  • Error message text color: via the color resource named {@code * gv_snackbar_error_text}
  • Error message font: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code * assets} folder
  • Error message text style: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.TextStyle} and setting an item named {@code android:textStyle} to {@code normal} , {@code bold} or {@code * italic}
  • Error message text size: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.TextStyle} and setting an item named {@code android:textSize} to the desired {@code sp} size
  • Error message button text color: via the color resource named {@code * gv_snackbar_error_button_title} and {@code gv_snackbar_error_button_title_pressed}
  • Error message button font: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.Button.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code assets} folder
  • Error message button text style: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.Button.TextStyle} and setting an item named {@code android:textStyle} to {@code normal} , {@code bold} or {@code italic}
  • Error message button text size: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.Button.TextStyle} and setting an item named {@code android:textSize} to the desired {@code sp} size
  • Error message background color: via the color resource named {@code * gv_snackbar_error_background}
  • Document analysis error message retry button text: via the string resource named {@code gv_document_analysis_error_retry}

Important: All overriden styles must have their respective {@code Root.} prefixed style as their parent. Ex.: the parent of {@code GiniVisionTheme.Snackbar.Error.TextStyle} must be {@code * Root.GiniVisionTheme.Snackbar.Error.TextStyle} .

Customizing the Action Bar

Customizing the Action Bar is also done via overriding of app resources and each one - except the title string resource - is global to all Activities ( CameraActivity , OnboardingActivity , ReviewActivity , net.gini.android.vision.review.multipage.MultiPageReviewActivity , AnalysisActivity ).

The following items are customizable:

  • Background color: via the color resource named {@code gv_action_bar} (highly recommended for Android 5+: customize the status bar color via {@code gv_status_bar} )
  • Back button (only for ReviewActivity and AnalysisActivity ): via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code gv_action_bar_back}

public class AnalysisActivity extends AppCompatActivity implements AnalysisFragmentListener, AnalysisFragmentInterface

Functions

addContentView
Link copied to clipboard
void addContentView(View view, ViewGroup.LayoutParams params)
allocateRequestIndex
Link copied to clipboard
int allocateRequestIndex(Fragment fragment)
applyOverrideConfiguration
Link copied to clipboard
attachBaseContext
Link copied to clipboard
void attachBaseContext(Context newBase)
bindIsolatedService
Link copied to clipboard
bindService
Link copied to clipboard
boolean bindService(Intent service, ServiceConnection conn, int flags)
bindServiceAsUser
Link copied to clipboard
boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags, UserHandle user)
checkCallingOrSelfPermission
Link copied to clipboard
int checkCallingOrSelfPermission(String permission)
checkCallingOrSelfUriPermission
Link copied to clipboard
int checkCallingOrSelfUriPermission(Uri uri, int modeFlags)
checkCallingPermission
Link copied to clipboard
int checkCallingPermission(String permission)
checkCallingUriPermission
Link copied to clipboard
int checkCallingUriPermission(Uri uri, int modeFlags)
checkForValidRequestCode
Link copied to clipboard
static void checkForValidRequestCode(int requestCode)
checkPermission
Link copied to clipboard
int checkPermission(String permission, int pid, int uid)
checkSelfPermission
Link copied to clipboard
int checkSelfPermission(String permission)
checkUriPermission
Link copied to clipboard
int checkUriPermission(Uri uri, int pid, int uid, int modeFlags)
clearWallpaper
Link copied to clipboard
void clearWallpaper()
closeContextMenu
Link copied to clipboard
void closeContextMenu()
closeOptionsMenu
Link copied to clipboard
void closeOptionsMenu()
createAttributionContext
Link copied to clipboard
Context createAttributionContext(String attributionTag)
createConfigurationContext
Link copied to clipboard
createContextForSplit
Link copied to clipboard
Context createContextForSplit(String splitName)
createDeviceProtectedStorageContext
Link copied to clipboard
Context createDeviceProtectedStorageContext()
createDisplayContext
Link copied to clipboard
Context createDisplayContext(Display display)
createPackageContext
Link copied to clipboard
Context createPackageContext(String packageName, int flags)
createPendingResult
Link copied to clipboard
PendingIntent createPendingResult(int requestCode, Intent data, int flags)
createWindowContext
Link copied to clipboard
Context createWindowContext(int type, Bundle options)
databaseList
Link copied to clipboard
Array<StringdatabaseList()
deleteDatabase
Link copied to clipboard
boolean deleteDatabase(String name)
deleteFile
Link copied to clipboard
boolean deleteFile(String name)
deleteSharedPreferences
Link copied to clipboard
boolean deleteSharedPreferences(String name)
dismissDialog
Link copied to clipboard
final void dismissDialog(int id)
dismissKeyboardShortcutsHelper
Link copied to clipboard
final void dismissKeyboardShortcutsHelper()
dispatchFragmentsOnCreateView
Link copied to clipboard
dispatchGenericMotionEvent
Link copied to clipboard
boolean dispatchGenericMotionEvent(MotionEvent ev)
dispatchKeyEvent
Link copied to clipboard
boolean dispatchKeyEvent(KeyEvent event)
dispatchKeyShortcutEvent
Link copied to clipboard
boolean dispatchKeyShortcutEvent(KeyEvent event)
dispatchPopulateAccessibilityEvent
Link copied to clipboard
boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
dispatchTouchEvent
Link copied to clipboard
boolean dispatchTouchEvent(MotionEvent ev)
dispatchTrackballEvent
Link copied to clipboard
boolean dispatchTrackballEvent(MotionEvent ev)
dump
Link copied to clipboard
void dump(String prefix, FileDescriptor fd, PrintWriter writer, Array<Stringargs)
enforceCallingOrSelfPermission
Link copied to clipboard
void enforceCallingOrSelfPermission(String permission, String message)
enforceCallingOrSelfUriPermission
Link copied to clipboard
void enforceCallingOrSelfUriPermission(Uri uri, int modeFlags, String message)
enforceCallingPermission
Link copied to clipboard
void enforceCallingPermission(String permission, String message)
enforceCallingUriPermission
Link copied to clipboard
void enforceCallingUriPermission(Uri uri, int modeFlags, String message)
enforcePermission
Link copied to clipboard
void enforcePermission(String permission, int pid, int uid, String message)
enforceUriPermission
Link copied to clipboard
void enforceUriPermission(Uri uri, int pid, int uid, int modeFlags, String message)
enterPictureInPictureMode
Link copied to clipboard
void enterPictureInPictureMode()
boolean enterPictureInPictureMode(PictureInPictureParams params)
fileList
Link copied to clipboard
Array<StringfileList()
findViewById
Link copied to clipboard
T findViewById<T extends View>(int id)
finish
Link copied to clipboard
void finish()
finishActivity
Link copied to clipboard
void finishActivity(int requestCode)
finishActivityFromChild
Link copied to clipboard
void finishActivityFromChild(Activity child, int requestCode)
finishAffinity
Link copied to clipboard
void finishAffinity()
finishAfterTransition
Link copied to clipboard
void finishAfterTransition()
finishAndRemoveTask
Link copied to clipboard
void finishAndRemoveTask()
finishFromChild
Link copied to clipboard
void finishFromChild(Activity child)
getActionBar
Link copied to clipboard
ActionBar getActionBar()
getApplication
Link copied to clipboard
final Application getApplication()
getApplicationContext
Link copied to clipboard
Context getApplicationContext()
getApplicationInfo
Link copied to clipboard
ApplicationInfo getApplicationInfo()
getAssets
Link copied to clipboard
AssetManager getAssets()
getAttributionTag
Link copied to clipboard
String getAttributionTag()
getBaseContext
Link copied to clipboard
Context getBaseContext()
getCacheDir
Link copied to clipboard
File getCacheDir()
getCallingActivity
Link copied to clipboard
ComponentName getCallingActivity()
getCallingPackage
Link copied to clipboard
String getCallingPackage()
getChangingConfigurations
Link copied to clipboard
int getChangingConfigurations()
getClassLoader
Link copied to clipboard
ClassLoader getClassLoader()
getCodeCacheDir
Link copied to clipboard
File getCodeCacheDir()
getColor
Link copied to clipboard
final int getColor(int id)
getColorStateList
Link copied to clipboard
final ColorStateList getColorStateList(int id)
getComponentName
Link copied to clipboard
ComponentName getComponentName()
getContentResolver
Link copied to clipboard
ContentResolver getContentResolver()
getContentScene
Link copied to clipboard
Scene getContentScene()
getContentTransitionManager
Link copied to clipboard
TransitionManager getContentTransitionManager()
getCurrentFocus
Link copied to clipboard
View getCurrentFocus()
getDatabasePath
Link copied to clipboard
File getDatabasePath(String name)
getDataDir
Link copied to clipboard
File getDataDir()
getDefaultViewModelProviderFactory
Link copied to clipboard
getDelegate
Link copied to clipboard
AppCompatDelegate getDelegate()
getDir
Link copied to clipboard
File getDir(String name, int mode)
getDisplay
Link copied to clipboard
Display getDisplay()
getDrawable
Link copied to clipboard
final Drawable getDrawable(int id)
getDrawerToggleDelegate
Link copied to clipboard
getExternalCacheDir
Link copied to clipboard
File getExternalCacheDir()
getExternalCacheDirs
Link copied to clipboard
Array<FilegetExternalCacheDirs()
getExternalFilesDir
Link copied to clipboard
File getExternalFilesDir(String type)
getExternalFilesDirs
Link copied to clipboard
Array<FilegetExternalFilesDirs(String type)
getExternalMediaDirs
Link copied to clipboard
Array<FilegetExternalMediaDirs()
getExtraData
Link copied to clipboard
T getExtraData<T extends ComponentActivity.ExtraData>(Class<TextraDataClass)
getFilesDir
Link copied to clipboard
File getFilesDir()
getFileStreamPath
Link copied to clipboard
File getFileStreamPath(String name)
getFragment
Link copied to clipboard
AnalysisFragmentCompat getFragment()
getFragmentManager
Link copied to clipboard
FragmentManager getFragmentManager()
getIntent
Link copied to clipboard
Intent getIntent()
getLastCustomNonConfigurationInstance
Link copied to clipboard
Object getLastCustomNonConfigurationInstance()
getLastNonConfigurationInstance
Link copied to clipboard
Object getLastNonConfigurationInstance()
getLayoutInflater
Link copied to clipboard
LayoutInflater getLayoutInflater()
getLifecycle
Link copied to clipboard
Lifecycle getLifecycle()
getLoaderManager
Link copied to clipboard
LoaderManager getLoaderManager()
getLocalClassName
Link copied to clipboard
String getLocalClassName()
getMainExecutor
Link copied to clipboard
Executor getMainExecutor()
getMainLooper
Link copied to clipboard
Looper getMainLooper()
getMaxNumPictureInPictureActions
Link copied to clipboard
int getMaxNumPictureInPictureActions()
getMediaController
Link copied to clipboard
final MediaController getMediaController()
getMenuInflater
Link copied to clipboard
MenuInflater getMenuInflater()
getNoBackupFilesDir
Link copied to clipboard
File getNoBackupFilesDir()
getObbDir
Link copied to clipboard
File getObbDir()
getObbDirs
Link copied to clipboard
Array<FilegetObbDirs()
getOnBackPressedDispatcher
Link copied to clipboard
final OnBackPressedDispatcher getOnBackPressedDispatcher()
getOpPackageName
Link copied to clipboard
String getOpPackageName()
getPackageCodePath
Link copied to clipboard
String getPackageCodePath()
getPackageManager
Link copied to clipboard
PackageManager getPackageManager()
getPackageName
Link copied to clipboard
String getPackageName()
getPackageResourcePath
Link copied to clipboard
String getPackageResourcePath()
getParent
Link copied to clipboard
final Activity getParent()
getParentActivityIntent
Link copied to clipboard
Intent getParentActivityIntent()
getPreferences
Link copied to clipboard
SharedPreferences getPreferences(int mode)
getReferrer
Link copied to clipboard
Uri getReferrer()
getRequestedOrientation
Link copied to clipboard
int getRequestedOrientation()
getResources
Link copied to clipboard
Resources getResources()
getSavedStateRegistry
Link copied to clipboard
final SavedStateRegistry getSavedStateRegistry()
getSearchEvent
Link copied to clipboard
final SearchEvent getSearchEvent()
getSharedPreferences
Link copied to clipboard
SharedPreferences getSharedPreferences(String name, int mode)
getString
Link copied to clipboard
final String getString(int resId)
getSupportActionBar
Link copied to clipboard
ActionBar getSupportActionBar()
getSupportFragmentManager
Link copied to clipboard
FragmentManager getSupportFragmentManager()
getSupportLoaderManager
Link copied to clipboard
LoaderManager getSupportLoaderManager()
getSupportParentActivityIntent
Link copied to clipboard
Intent getSupportParentActivityIntent()
getSystemService
Link copied to clipboard
Object getSystemService(String name)
final T getSystemService<T>(Class<TserviceClass)
getSystemServiceName
Link copied to clipboard
String getSystemServiceName(Class<? extends ObjectserviceClass)
getTaskId
Link copied to clipboard
int getTaskId()
getText
Link copied to clipboard
final CharSequence getText(int resId)
getTheme
Link copied to clipboard
Resources.Theme getTheme()
getTitle
Link copied to clipboard
final CharSequence getTitle()
getTitleColor
Link copied to clipboard
final int getTitleColor()
getViewModelStore
Link copied to clipboard
ViewModelStore getViewModelStore()
getVoiceInteractor
Link copied to clipboard
VoiceInteractor getVoiceInteractor()
getVolumeControlStream
Link copied to clipboard
final int getVolumeControlStream()
getWallpaper
Link copied to clipboard
Drawable getWallpaper()
getWallpaperDesiredMinimumHeight
Link copied to clipboard
int getWallpaperDesiredMinimumHeight()
getWallpaperDesiredMinimumWidth
Link copied to clipboard
int getWallpaperDesiredMinimumWidth()
getWindow
Link copied to clipboard
Window getWindow()
getWindowManager
Link copied to clipboard
WindowManager getWindowManager()
grantUriPermission
Link copied to clipboard
void grantUriPermission(String toPackage, Uri uri, int modeFlags)
hasWindowFocus
Link copied to clipboard
boolean hasWindowFocus()
hideError
Link copied to clipboard

Call this method to hide the error shown before with showError or showError .

void hideError()
invalidateOptionsMenu
Link copied to clipboard
void invalidateOptionsMenu()
isActivityTransitionRunning
Link copied to clipboard
boolean isActivityTransitionRunning()
isChangingConfigurations
Link copied to clipboard
boolean isChangingConfigurations()
isChild
Link copied to clipboard
final boolean isChild()
isDestroyed
Link copied to clipboard
boolean isDestroyed()
isDeviceProtectedStorage
Link copied to clipboard
boolean isDeviceProtectedStorage()
isFinishing
Link copied to clipboard
boolean isFinishing()
isImmersive
Link copied to clipboard
boolean isImmersive()
isInMultiWindowMode
Link copied to clipboard
boolean isInMultiWindowMode()
isInPictureInPictureMode
Link copied to clipboard
boolean isInPictureInPictureMode()
isLocalVoiceInteractionSupported
Link copied to clipboard
boolean isLocalVoiceInteractionSupported()
isRestricted
Link copied to clipboard
boolean isRestricted()
isTaskRoot
Link copied to clipboard
boolean isTaskRoot()
isVoiceInteraction
Link copied to clipboard
boolean isVoiceInteraction()
isVoiceInteractionRoot
Link copied to clipboard
boolean isVoiceInteractionRoot()
managedQuery
Link copied to clipboard
markFragmentsCreated
Link copied to clipboard
void markFragmentsCreated()
markState
Link copied to clipboard
static boolean markState(FragmentManager manager, Lifecycle.State state)
moveDatabaseFrom
Link copied to clipboard
boolean moveDatabaseFrom(Context sourceContext, String name)
moveSharedPreferencesFrom
Link copied to clipboard
boolean moveSharedPreferencesFrom(Context sourceContext, String name)
moveTaskToBack
Link copied to clipboard
boolean moveTaskToBack(boolean nonRoot)
navigateUpTo
Link copied to clipboard
boolean navigateUpTo(Intent upIntent)
navigateUpToFromChild
Link copied to clipboard
boolean navigateUpToFromChild(Activity child, Intent upIntent)
obtainStyledAttributes
Link copied to clipboard
final TypedArray obtainStyledAttributes(Array<int> attrs)
onActionModeFinished
Link copied to clipboard
void onActionModeFinished(ActionMode mode)
onActionModeStarted
Link copied to clipboard
void onActionModeStarted(ActionMode mode)
onActivityReenter
Link copied to clipboard
void onActivityReenter(int resultCode, Intent data)
onActivityResult
Link copied to clipboard
void onActivityResult(int requestCode, int resultCode, Intent data)
onAddDataToResult
Link copied to clipboard

Callback for adding your own data to the Activity's result.

Called when the document was analyzed.

You should add the results of the analysis as extras and retrieve them when the returned.

Note: you must call onDocumentAnalyzed after you received the analysis results from the Gini API, otherwise this method won't be invoked.

void onAddDataToResult(Intent result)
onAnalyzeDocument
Link copied to clipboard

Screen API: If an analysis error message was set in the Review Screen with this method won't be called until the user clicks the retry button next to the error message.

void onAnalyzeDocument(Document document)

Called when the Analyze Document Fragment is started and the document can be analyzed.

abstract void onAnalyzeDocument(Document document)
onApplyThemeResource
Link copied to clipboard
void onApplyThemeResource(Resources.Theme theme, int resid, boolean first)
onAttachedToWindow
Link copied to clipboard
void onAttachedToWindow()
onAttachFragment
Link copied to clipboard
void onAttachFragment(Fragment fragment)
onBackPressed
Link copied to clipboard
void onBackPressed()
void onBackPressed()
onChildTitleChanged
Link copied to clipboard
void onChildTitleChanged(Activity childActivity, CharSequence title)
onConfigurationChanged
Link copied to clipboard
void onConfigurationChanged(Configuration newConfig)
onContentChanged
Link copied to clipboard
void onContentChanged()
onContextItemSelected
Link copied to clipboard
boolean onContextItemSelected(MenuItem item)
onContextMenuClosed
Link copied to clipboard
void onContextMenuClosed(Menu menu)
onCreate
Link copied to clipboard
void onCreate(Bundle savedInstanceState)
onCreateContextMenu
Link copied to clipboard
onCreateDescription
Link copied to clipboard
CharSequence onCreateDescription()
onCreateDialog
Link copied to clipboard
Dialog onCreateDialog(int id)
onCreateNavigateUpTaskStack
Link copied to clipboard
void onCreateNavigateUpTaskStack(TaskStackBuilder builder)
onCreateOptionsMenu
Link copied to clipboard
boolean onCreateOptionsMenu(Menu menu)
onCreatePanelMenu
Link copied to clipboard
boolean onCreatePanelMenu(int featureId, Menu menu)
onCreatePanelView
Link copied to clipboard
View onCreatePanelView(int featureId)
onCreateSupportNavigateUpTaskStack
Link copied to clipboard
void onCreateSupportNavigateUpTaskStack(TaskStackBuilder builder)
onCreateThumbnail
Link copied to clipboard
boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas)
onCreateView
Link copied to clipboard
View onCreateView(View parent, String name, Context context, AttributeSet attrs)
onDefaultPDFAppAlertDialogCancelled
Link copied to clipboard

Called when the default PDF app alert dialog was cancelled. You should close the AnalysisFragment because the user decided not to continue with analysis.

This alert dialog is shown for PDFs imported from another app when your app was set as default for opening PDFs.

void onDefaultPDFAppAlertDialogCancelled()
onDestroy
Link copied to clipboard
void onDestroy()
onDetachedFromWindow
Link copied to clipboard
void onDetachedFromWindow()
onDocumentAnalyzed
Link copied to clipboard
void onDocumentAnalyzed()
onEnterAnimationComplete
Link copied to clipboard
void onEnterAnimationComplete()
onError
Link copied to clipboard

Called when an error occurred.

void onError(GiniVisionError error)
abstract void onError(GiniVisionError error)
onExtractionsAvailable
Link copied to clipboard

Called when the document has been analyzed and extractions are available.

onGenericMotionEvent
Link copied to clipboard
boolean onGenericMotionEvent(MotionEvent event)
onGetDirectActions
Link copied to clipboard
onKeyDown
Link copied to clipboard
boolean onKeyDown(int keyCode, KeyEvent event)
onKeyLongPress
Link copied to clipboard
boolean onKeyLongPress(int keyCode, KeyEvent event)
onKeyMultiple
Link copied to clipboard
boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event)
onKeyShortcut
Link copied to clipboard
boolean onKeyShortcut(int keyCode, KeyEvent event)
onKeyUp
Link copied to clipboard
boolean onKeyUp(int keyCode, KeyEvent event)
onLocalVoiceInteractionStarted
Link copied to clipboard
void onLocalVoiceInteractionStarted()
onLocalVoiceInteractionStopped
Link copied to clipboard
void onLocalVoiceInteractionStopped()
onLowMemory
Link copied to clipboard
void onLowMemory()
onMenuItemSelected
Link copied to clipboard
final boolean onMenuItemSelected(int featureId, MenuItem item)
onMenuOpened
Link copied to clipboard
boolean onMenuOpened(int featureId, Menu menu)
onMultiWindowModeChanged
Link copied to clipboard
void onMultiWindowModeChanged(boolean isInMultiWindowMode)
onNavigateUp
Link copied to clipboard
boolean onNavigateUp()
onNavigateUpFromChild
Link copied to clipboard
boolean onNavigateUpFromChild(Activity child)
onNewIntent
Link copied to clipboard
void onNewIntent(Intent intent)
onNightModeChanged
Link copied to clipboard
void onNightModeChanged(int mode)
onNoExtractionsFound
Link copied to clipboard

You should call this method after you've received the analysis results from the Gini API without the required extractions.

It will launch the NoResultsActivity , if the Document 's type is . For other types it will just finish the {@code AnalysisActivity} with {@code RESULT_OK} .

void onNoExtractionsFound()
onOptionsItemSelected
Link copied to clipboard
boolean onOptionsItemSelected(MenuItem item)
boolean onOptionsItemSelected(MenuItem item)
onOptionsMenuClosed
Link copied to clipboard
void onOptionsMenuClosed(Menu menu)
onPanelClosed
Link copied to clipboard
void onPanelClosed(int featureId, Menu menu)
onPause
Link copied to clipboard
void onPause()
onPerformDirectAction
Link copied to clipboard
onPictureInPictureModeChanged
Link copied to clipboard
void onPictureInPictureModeChanged(boolean isInPictureInPictureMode)
onPictureInPictureRequested
Link copied to clipboard
boolean onPictureInPictureRequested()
onPointerCaptureChanged
Link copied to clipboard
void onPointerCaptureChanged(boolean hasCapture)
onPostCreate
Link copied to clipboard
void onPostCreate(Bundle savedInstanceState)
onPostResume
Link copied to clipboard
void onPostResume()
onPrepareDialog
Link copied to clipboard
void onPrepareDialog(int id, Dialog dialog)
onPrepareNavigateUpTaskStack
Link copied to clipboard
void onPrepareNavigateUpTaskStack(TaskStackBuilder builder)
onPrepareOptionsMenu
Link copied to clipboard
boolean onPrepareOptionsMenu(Menu menu)
onPrepareOptionsPanel
Link copied to clipboard
boolean onPrepareOptionsPanel(View view, Menu menu)
onPreparePanel
Link copied to clipboard
boolean onPreparePanel(int featureId, View view, Menu menu)
onPrepareSupportNavigateUpTaskStack
Link copied to clipboard
onProceedToNoExtractionsScreen
Link copied to clipboard

Called when the document has been analyzed and no extractions were received.

You should show the NoResultsFragmentStandard or NoResultsFragmentCompat .

void onProceedToNoExtractionsScreen(Document document)
onProvideAssistContent
Link copied to clipboard
void onProvideAssistContent(AssistContent outContent)
onProvideAssistData
Link copied to clipboard
void onProvideAssistData(Bundle data)
onProvideKeyboardShortcuts
Link copied to clipboard
void onProvideKeyboardShortcuts(List<KeyboardShortcutGroupdata, Menu menu, int deviceId)
onProvideReferrer
Link copied to clipboard
Uri onProvideReferrer()
onRequestPermissionsResult
Link copied to clipboard
void onRequestPermissionsResult(int requestCode, Array<Stringpermissions, Array<int> grantResults)
onRestart
Link copied to clipboard
void onRestart()
onRestoreInstanceState
Link copied to clipboard
void onRestoreInstanceState(Bundle savedInstanceState)
onResume
Link copied to clipboard
void onResume()
onResumeFragments
Link copied to clipboard
void onResumeFragments()
onRetainCustomNonConfigurationInstance
Link copied to clipboard
Object onRetainCustomNonConfigurationInstance()
onRetainNonConfigurationInstance
Link copied to clipboard
final Object onRetainNonConfigurationInstance()
onSaveInstanceState
Link copied to clipboard
void onSaveInstanceState(Bundle outState)
onSearchRequested
Link copied to clipboard
boolean onSearchRequested(SearchEvent searchEvent)
onStart
Link copied to clipboard
void onStart()
onStateNotSaved
Link copied to clipboard
void onStateNotSaved()
onStop
Link copied to clipboard
void onStop()
onSupportActionModeFinished
Link copied to clipboard
void onSupportActionModeFinished(ActionMode mode)
onSupportActionModeStarted
Link copied to clipboard
void onSupportActionModeStarted(ActionMode mode)
onSupportContentChanged
Link copied to clipboard
void onSupportContentChanged()
onSupportNavigateUp
Link copied to clipboard
boolean onSupportNavigateUp()
onTitleChanged
Link copied to clipboard
void onTitleChanged(CharSequence title, int color)
onTopResumedActivityChanged
Link copied to clipboard
void onTopResumedActivityChanged(boolean isTopResumedActivity)
onTouchEvent
Link copied to clipboard
boolean onTouchEvent(MotionEvent event)
onTrackballEvent
Link copied to clipboard
boolean onTrackballEvent(MotionEvent event)
onTrimMemory
Link copied to clipboard
void onTrimMemory(int level)
onUserInteraction
Link copied to clipboard
void onUserInteraction()
onUserLeaveHint
Link copied to clipboard
void onUserLeaveHint()
onVisibleBehindCanceled
Link copied to clipboard
void onVisibleBehindCanceled()
onWindowAttributesChanged
Link copied to clipboard
void onWindowAttributesChanged(WindowManager.LayoutParams params)
onWindowFocusChanged
Link copied to clipboard
void onWindowFocusChanged(boolean hasFocus)
onWindowStartingActionMode
Link copied to clipboard
onWindowStartingSupportActionMode
Link copied to clipboard
openContextMenu
Link copied to clipboard
void openContextMenu(View view)
openFileInput
Link copied to clipboard
FileInputStream openFileInput(String name)
openFileOutput
Link copied to clipboard
FileOutputStream openFileOutput(String name, int mode)
openOptionsMenu
Link copied to clipboard
void openOptionsMenu()
openOrCreateDatabase
Link copied to clipboard
overridePendingTransition
Link copied to clipboard
void overridePendingTransition(int enterAnim, int exitAnim)
peekWallpaper
Link copied to clipboard
Drawable peekWallpaper()
performMenuItemShortcut
Link copied to clipboard
boolean performMenuItemShortcut(KeyEvent event)
postponeEnterTransition
Link copied to clipboard
void postponeEnterTransition()
putExtraData
Link copied to clipboard
void putExtraData(ComponentActivity.ExtraData extraData)
recreate
Link copied to clipboard
void recreate()
registerActivityLifecycleCallbacks
Link copied to clipboard
registerComponentCallbacks
Link copied to clipboard
void registerComponentCallbacks(ComponentCallbacks callback)
registerForContextMenu
Link copied to clipboard
void registerForContextMenu(View view)
registerReceiver
Link copied to clipboard
releaseInstance
Link copied to clipboard
boolean releaseInstance()
removeDialog
Link copied to clipboard
final void removeDialog(int id)
removeStickyBroadcast
Link copied to clipboard
void removeStickyBroadcast(Intent intent)
removeStickyBroadcastAsUser
Link copied to clipboard
void removeStickyBroadcastAsUser(Intent intent, UserHandle user)
reportFullyDrawn
Link copied to clipboard
void reportFullyDrawn()
requestDragAndDropPermissions
Link copied to clipboard
requestPermissions
Link copied to clipboard
final void requestPermissions(Array<Stringpermissions, int requestCode)
requestPermissionsFromFragment
Link copied to clipboard
requestShowKeyboardShortcuts
Link copied to clipboard
final void requestShowKeyboardShortcuts()
requestVisibleBehind
Link copied to clipboard
boolean requestVisibleBehind(boolean visible)
requestWindowFeature
Link copied to clipboard
final boolean requestWindowFeature(int featureId)
requireViewById
Link copied to clipboard
final T requireViewById<T extends View>(int id)
revokeUriPermission
Link copied to clipboard
void revokeUriPermission(Uri uri, int modeFlags)
runOnUiThread
Link copied to clipboard
final void runOnUiThread(Runnable action)
sendBroadcast
Link copied to clipboard
void sendBroadcast(Intent intent)
sendBroadcastAsUser
Link copied to clipboard
void sendBroadcastAsUser(Intent intent, UserHandle user)
sendBroadcastWithMultiplePermissions
Link copied to clipboard
sendOrderedBroadcast
Link copied to clipboard
void sendOrderedBroadcast(Intent intent, String receiverPermission)
sendStickyBroadcast
Link copied to clipboard
void sendStickyBroadcast(Intent intent)
sendStickyBroadcastAsUser
Link copied to clipboard
void sendStickyBroadcastAsUser(Intent intent, UserHandle user)
setActionBar
Link copied to clipboard
void setActionBar(Toolbar toolbar)
setContentTransitionManager
Link copied to clipboard
void setContentTransitionManager(TransitionManager tm)
setContentView
Link copied to clipboard
void setContentView(int layoutResID)
setDefaultKeyMode
Link copied to clipboard
final void setDefaultKeyMode(int mode)
setEnterSharedElementCallback
Link copied to clipboard
setExitSharedElementCallback
Link copied to clipboard
void setExitSharedElementCallback(SharedElementCallback listener)
setFeatureDrawable
Link copied to clipboard
final void setFeatureDrawable(int featureId, Drawable drawable)
setFeatureDrawableAlpha
Link copied to clipboard
final void setFeatureDrawableAlpha(int featureId, int alpha)
setFeatureDrawableResource
Link copied to clipboard
final void setFeatureDrawableResource(int featureId, int resId)
setFeatureDrawableUri
Link copied to clipboard
final void setFeatureDrawableUri(int featureId, Uri uri)
setFinishOnTouchOutside
Link copied to clipboard
void setFinishOnTouchOutside(boolean finish)
setImmersive
Link copied to clipboard
void setImmersive(boolean i)
setInheritShowWhenLocked
Link copied to clipboard
void setInheritShowWhenLocked(boolean inheritShowWhenLocked)
setIntent
Link copied to clipboard
void setIntent(Intent newIntent)
setListener
Link copied to clipboard

Set a listener for analysis events.

By default the hosting Activity is expected to implement the AnalysisFragmentListener . In case that is not feasible you may set the listener using this method.

Note: the listener is expected to be available until the fragment is attached to an activity. Make sure to set the listener before that.

void setListener(AnalysisFragmentListener listener)
setLocusContext
Link copied to clipboard
void setLocusContext(LocusId locusId, Bundle bundle)
setMediaController
Link copied to clipboard
final void setMediaController(MediaController controller)
setPictureInPictureParams
Link copied to clipboard
void setPictureInPictureParams(PictureInPictureParams params)
setProgress
Link copied to clipboard
final void setProgress(int progress)
setProgressBarIndeterminate
Link copied to clipboard
final void setProgressBarIndeterminate(boolean indeterminate)
setProgressBarIndeterminateVisibility
Link copied to clipboard
final void setProgressBarIndeterminateVisibility(boolean visible)
setProgressBarVisibility
Link copied to clipboard
final void setProgressBarVisibility(boolean visible)
setRequestedOrientation
Link copied to clipboard
void setRequestedOrientation(int requestedOrientation)
setResult
Link copied to clipboard
final void setResult(int resultCode)
setSecondaryProgress
Link copied to clipboard
final void setSecondaryProgress(int secondaryProgress)
setShowWhenLocked
Link copied to clipboard
void setShowWhenLocked(boolean showWhenLocked)
setSupportActionBar
Link copied to clipboard
void setSupportActionBar(Toolbar toolbar)
setSupportProgress
Link copied to clipboard
void setSupportProgress(int progress)
setSupportProgressBarIndeterminate
Link copied to clipboard
void setSupportProgressBarIndeterminate(boolean indeterminate)
setSupportProgressBarIndeterminateVisibility
Link copied to clipboard
void setSupportProgressBarIndeterminateVisibility(boolean visible)
setSupportProgressBarVisibility
Link copied to clipboard
void setSupportProgressBarVisibility(boolean visible)
setTaskDescription
Link copied to clipboard
setTheme
Link copied to clipboard
void setTheme(int resId)
setTitle
Link copied to clipboard
void setTitle(CharSequence title)
setTitleColor
Link copied to clipboard
void setTitleColor(int textColor)
setTranslucent
Link copied to clipboard
boolean setTranslucent(boolean translucent)
setTurnScreenOn
Link copied to clipboard
void setTurnScreenOn(boolean turnScreenOn)
setVisible
Link copied to clipboard
void setVisible(boolean visible)
setVolumeControlStream
Link copied to clipboard
final void setVolumeControlStream(int streamType)
setVrModeEnabled
Link copied to clipboard
void setVrModeEnabled(boolean enabled, ComponentName requestedComponent)
setWallpaper
Link copied to clipboard
void setWallpaper(Bitmap bitmap)
shouldShowRequestPermissionRationale
Link copied to clipboard
boolean shouldShowRequestPermissionRationale(String permission)
shouldUpRecreateTask
Link copied to clipboard
boolean shouldUpRecreateTask(Intent targetIntent)
showAssist
Link copied to clipboard
boolean showAssist(Bundle args)
showDialog
Link copied to clipboard
final void showDialog(int id)
final boolean showDialog(int id, Bundle args)
showError
Link copied to clipboard

Call this method when you need to show an error message to the user in the Analysis Screen.

void showError(String message, int duration)
abstract void showError(String message, int duration)

Call this method when you need to show an error message with an invokable action to the user in the Analysis Screen.

abstract void showError(String message, String buttonTitle, View.OnClickListener onClickListener)
showLockTaskEscapeMessage
Link copied to clipboard
void showLockTaskEscapeMessage()
startActionMode
Link copied to clipboard
startActivities
Link copied to clipboard
void startActivities(Array<Intentintents)
startActivity
Link copied to clipboard
void startActivity(Intent intent)
startActivityForResult
Link copied to clipboard
void startActivityForResult(Intent intent, int requestCode)
startActivityFromChild
Link copied to clipboard
void startActivityFromChild(Activity child, Intent intent, int requestCode)
startActivityFromFragment
Link copied to clipboard
void startActivityFromFragment(Fragment fragment, Intent intent, int requestCode)
startActivityIfNeeded
Link copied to clipboard
boolean startActivityIfNeeded(Intent intent, int requestCode)
startForegroundService
Link copied to clipboard
ComponentName startForegroundService(Intent service)
startInstrumentation
Link copied to clipboard
startIntentSender
Link copied to clipboard
void startIntentSender(IntentSender intent, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
startIntentSenderForResult
Link copied to clipboard
void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
startIntentSenderFromChild
Link copied to clipboard
startIntentSenderFromFragment
Link copied to clipboard
startLocalVoiceInteraction
Link copied to clipboard
void startLocalVoiceInteraction(Bundle privateOptions)
startLockTask
Link copied to clipboard
void startLockTask()
startManagingCursor
Link copied to clipboard
void startManagingCursor(Cursor c)
startNextMatchingActivity
Link copied to clipboard
boolean startNextMatchingActivity(Intent intent)
startPostponedEnterTransition
Link copied to clipboard
void startPostponedEnterTransition()
startScanAnimation
Link copied to clipboard
void startScanAnimation()
startSearch
Link copied to clipboard
void startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, boolean globalSearch)
startService
Link copied to clipboard
ComponentName startService(Intent service)
startSupportActionMode
Link copied to clipboard
stopLocalVoiceInteraction
Link copied to clipboard
void stopLocalVoiceInteraction()
stopLockTask
Link copied to clipboard
void stopLockTask()
stopManagingCursor
Link copied to clipboard
void stopManagingCursor(Cursor c)
stopScanAnimation
Link copied to clipboard
void stopScanAnimation()
stopService
Link copied to clipboard
boolean stopService(Intent name)
superDispatchKeyEvent
Link copied to clipboard
boolean superDispatchKeyEvent(KeyEvent event)
supportFinishAfterTransition
Link copied to clipboard
void supportFinishAfterTransition()
supportInvalidateOptionsMenu
Link copied to clipboard
void supportInvalidateOptionsMenu()
supportNavigateUpTo
Link copied to clipboard
void supportNavigateUpTo(Intent upIntent)
supportPostponeEnterTransition
Link copied to clipboard
void supportPostponeEnterTransition()
supportRequestWindowFeature
Link copied to clipboard
boolean supportRequestWindowFeature(int featureId)
supportShouldUpRecreateTask
Link copied to clipboard
boolean supportShouldUpRecreateTask(Intent targetIntent)
supportStartPostponedEnterTransition
Link copied to clipboard
void supportStartPostponedEnterTransition()
takeKeyEvents
Link copied to clipboard
void takeKeyEvents(boolean get)
triggerSearch
Link copied to clipboard
void triggerSearch(String query, Bundle appSearchData)
unbindService
Link copied to clipboard
void unbindService(ServiceConnection conn)
unregisterComponentCallbacks
Link copied to clipboard
void unregisterComponentCallbacks(ComponentCallbacks callback)
unregisterForContextMenu
Link copied to clipboard
void unregisterForContextMenu(View view)
unregisterReceiver
Link copied to clipboard
void unregisterReceiver(BroadcastReceiver receiver)
updateServiceGroup
Link copied to clipboard
void updateServiceGroup(ServiceConnection conn, int group, int importance)
validateRequestPermissionsRequestCode
Link copied to clipboard
final void validateRequestPermissionsRequestCode(int requestCode)

Properties

EXTRA_IN_DOCUMENT
Link copied to clipboard

Internal use only.

public final static String EXTRA_IN_DOCUMENT
EXTRA_IN_DOCUMENT_ANALYSIS_ERROR_MESSAGE
Link copied to clipboard

Internal use only.

public final static String EXTRA_IN_DOCUMENT_ANALYSIS_ERROR_MESSAGE
EXTRA_OUT_ERROR
Link copied to clipboard

Internal use only.

public final static String EXTRA_OUT_ERROR
RESULT_ERROR
Link copied to clipboard

Internal use only.

public final static int RESULT_ERROR
RESULT_NO_EXTRACTIONS
Link copied to clipboard

Internal use only.

public final static int RESULT_NO_EXTRACTIONS