Skip to content

Instantly share code, notes, and snippets.

View wei-spring's full-sized avatar
🏠
Working from home

魏春生 wei-spring

🏠
Working from home
View GitHub Profile
@PasanBhanu
PasanBhanu / AndroidDownloadImage.java
Created September 26, 2019 09:04
Download Image from URL and Added to Gallery - Android (Java)
/*
This method can be used to download an image from the internet using a url in Android. This use Android Download Manager to
download the file and added it to the Gallery. Downloaded image will be saved to "Pictures"
Folder in your internal storage
*/
private void downloadImageNew(String filename, String downloadUrlOfImage){
try{
DownloadManager dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse(downloadUrlOfImage);
@aslamanver
aslamanver / main_screen.dart
Created October 3, 2019 11:09
Flutter custom inheritance - Extending the base class
import 'package:flutter/material.dart';
class MainScreen extends StatefulWidget {
@override
_MainScreenState createState() => _MainScreenState();
}
class _MainScreenState extends _BaseStatefulState<MainScreen> {
@override
Widget build(BuildContext context) {