public class DownloadManager {

    /**
     * ダウンロード完了リスナー
     *
     */
    public interface OnFinishedListener {
        /**
         *
         * @param result
         */
        public void onFinished(int result);
    }


    /**
     * @param url
     * @param file
     */
    public void DownloadStart(  final OnFinishedListener listener) {
        Log2.i("start:"+url);

	if(listener != null) {
	    listener.onFinished(result);
	}
    }
}

// 使う時
DownloadManager manager = new DownloadManager();
manager.DownloadStart( 
            new DownloadManager.OnFinishedListener() {
                @Override
                public void onFinished(int result) {
			Log2.i("finish");
                }
            });
}

© 2024 Falco Tech Blog Suffusion theme by Sayontan Sinha