Android AndroidRuntimeException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AndroidRuntimeException class.

This code example shows how to use the following methods:
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		if (!(getActivity() instanceof AkuzActivity)) { 
			throw new AndroidRuntimeException("The activity MUST inherit from " + AkuzActivity.class.getCanonicalName());
		} 
	} 
 
	/** 
	 * This method is final here because we should use buildUi. 
	 */ 
	@Override 
	public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		this.inflater = inflater;
		buildUi(); 
		return root;
	} 
 
	/** 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public DBFileManager(String dbFileName,
			SQLiteDatabase.CursorFactory factory) {
		this.factory = factory;
 
		if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
			throw new AndroidRuntimeException(
					"External storage (SD-Card) not mounted"); 
		} 
		File appDbDir = new File(Environment.getExternalStorageDirectory(),
				"Android/data/it.sasabz.android.sasabus/db"); 
		if (!appDbDir.exists()) {
			appDbDir.mkdirs();
		} 
		this.dbFile = new File(appDbDir, dbFileName);
	} 
 
	/** 
	 * This method controls if the db-file exists 
	 * @return true if the file exists, false otherwise 
	 */ 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		Notification notification = mManagedNotifications.get(id);
		if (notification == null) {
			notification = onCreateNotification(id);
			mManagedNotifications.put(id, notification);
			if (notification == null) {
				throw new AndroidRuntimeException(
						"Are you sure create notification in onCreateNotification which id is :" 
								+ id + "?");
			} 
		} 
		onPrepareNotification(id, notification);
		notificationManager.notify(id, notification);
	} 
 
	public void cancelNotification(int id) {
		ensureNotificationManager(); 
		Notification notification=null;
		if (mManagedNotifications != null) {
			notification = mManagedNotifications.get(id);
		} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		Notification notification = mManagedNotifications.get(id);
		if (notification == null) {
			notification = onCreateNotification(id);
			mManagedNotifications.put(id, notification);
			if (notification == null) {
				throw new AndroidRuntimeException(
						"Are you sure create notification in onCreateNotification which id is :" 
								+ id + "?");
			} 
		} 
		onPrepareNotification(id, notification);
		notificationManager.notify(id, notification);
	} 
 
	public void cancelNotification(int id) {
		ensureNotificationManager(); 
		Notification notification=null;
		if (mManagedNotifications != null) {
			notification = mManagedNotifications.get(id);
		} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public ExternalStorageReadOnlyOpenHelper( 
	    String dbFileName) {
	  // this.factory = factory; 
 
	   if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
	       throw new AndroidRuntimeException(
	           "External storage (SD-Card) not mounted"); 
	   }  
	   File appDbDir = new File(
	       Environment.getExternalStorageDirectory(),            
	       ""); 
	   if (!appDbDir.exists()) {
	       appDbDir.mkdirs();
	   } 
	   this.dbFile = new File(appDbDir, dbFileName);
	} 
 
	public boolean databaseFileExists() { 
	   return dbFile.exists();
	} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
		Notification notification = mManagedNotifications.get(id);
		if (notification == null) {
			notification = onCreateNotification(id);
			mManagedNotifications.put(id, notification);
			if (notification == null) {
				throw new AndroidRuntimeException(
						"Are you sure create notification in onCreateNotification which id is :" 
								+ id + "?");
			} 
		} 
		onPrepareNotification(id, notification);
		notificationManager.notify(id, notification);
	} 
 
	public void cancelNotification(int id) {
		ensureNotificationManager(); 
		Notification notification=null;
		if (mManagedNotifications != null) {
			notification = mManagedNotifications.get(id);
		} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                byte[] buffer = new byte[length];
                stream.read(buffer);
                return buffer;
 
            } catch (IOException ex) {
                throw new AndroidRuntimeException(ex);
            } 
        } 
 
        /** 
         * Generates a low resolution bitmap (1/4 of the size) that can be used for thumbnails to reduce memory 
         * usage. 
         * 
         * @return a bitmap with an image 1/4 of the size. 
         */ 
        public Bitmap getThumbnail() {
            BitmapFactory.Options options = new BitmapFactory.Options();
            // returns an image a quarter of the original size (this saves memory). 
            options.inSampleSize = 4;
            return BitmapFactory.decodeFile(file.getAbsolutePath(), options);
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Android AndroidRuntimeException Methods: