디시인사이드 갤러리

갤러리 이슈박스, 최근방문 갤러리

갤러리 본문 영역

이번에는 신종플루크형님을 위해 소스 올려드림

111(218.55) 2010.11.01 20:52:59
조회 137 추천 0 댓글 29

package pack.AppTV;


import java.io.File;
import java.io.FilenameFilter;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class MyContents extends Activity {
        ListView myListview;
        IconTextView temp;
        String rootPath;
        Drawable check;
        String[] lecture_num;
        String lecture_num1;
        String[] mplist;
        String[] temp1;
        String[] temp2;
        String temp3;
        String[] Lesson_name;
        String[] Lesson_time;
        String[] Lesson_date;
        String[] Drm_key;
        
        public static String Date;
         public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState); 
         
                setContentView(R.layout.mycontents);
               
                myListview = (ListView)findViewById(R.id.list1);        
                int ii=1;
                
                findViewById(R.id.numofdown);
                
                TextView downnum = (TextView)findViewById(R.id.downnum);
                
                
                
                ///////////////mp3 파일 받아오기
                rootPath = Environment.getDataDirectory().getAbsolutePath();
                rootPath += "/data/pack.AppTV/files/";
                File rootRoot = new File(rootPath);
                FilenameFilter filter = new FilenameFilter(){
                        public boolean accept(File dir, String name){
                                return name.endsWith(".mp3.ncg");
                        }
                };
                
                
              
                mplist = rootRoot.list(filter);

//                Toast.makeText(this, rootPath, Toast.LENGTH_LONG).show();
                ii=mplist.length;
                
                String[] lecture_num = new String[ii];
                String[] Lesson_name = new String[ii];
                String[] Lesson_time = new String[ii];
                String[] Lesson_date = new String[ii];
                String[] Drm_key = new String[ii];
                
                for(int i=0;i<ii;i++) {
                        lecture_num[i] = "";        
                        Lesson_name[i] = "";
                            Lesson_time[i] = "";
                            Lesson_date[i] = "";
                            Drm_key[i] = "";
                }
                
                for(int i=0;i<ii;i++){
//                        if(i==2) break;
                        lecture_num[i]=SPLIT(mplist[i],"00","_");
//                        lecture_num[i]=temp3;
                }
                
                for(int i=0;i<ii;i++)          ////////////이부분에서 넘어와야 되는데 안넘어옴
                {
                        for(int j=0;j<LectureList.NumOfLecture;j++){
                                if(lecture_num[i].equals(LectureList.Lesson_no[j])){
                                        Lesson_name[i] = LectureList.Lesson_nm[j];
                                        Lesson_time[i] = LectureList.Lesson_time[j];
                                        Lesson_date[i] = LectureList.Lesson_date[j];
                                        Drm_key[i] = LectureList.Drm_key[j];
                                }
                        }
                                
                }
                
                
                if(lecture_num[1].equals(LectureList.Lesson_no[1]))
                Toast.makeText(MyContents.this, Lesson_name[1], Toast.LENGTH_SHORT).show();
                else
                        Toast.makeText(MyContents.this, "!!!!"+LectureList.Lesson_nm[0]+"틀림"+LectureList.Lesson_no[1]+"!!!!", Toast.LENGTH_SHORT).show();
                
                
                downnum.setText(ii+"건");
                //리스트.........xml로 받을거긴 한데 그래도
                
                        AppTVAdapter adapter1 = new AppTVAdapter(this);
                        // add four items
                        Resources res = getResources();
                        for(int i=0;i<ii;i++){
                                adapter1.addItem(new ListClass(res.getDrawable(R.drawable.list_page_layer),Lesson_name[i], Lesson_date[i],Lesson_time[i]+"분",check));
                                check = res.getDrawable(R.drawable.readytoupdate);
                                check.setAlpha(0);
                        }
//                ((Drawable) res.getDrawable(R.drawable.candown)).settVisibility(View.GONE);  
                myListview.setAdapter(adapter1);
               
                

              //실험용 날짜가 안넘어와서
                        myListview.setOnItemClickListener(new OnItemClickListener() {

                                public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                                long arg3) {
                                Toast.makeText(MyContents.this, Variable.RDate[arg2], Toast.LENGTH_SHORT).show();
                                Intent intent = new Intent(MyContents.this, PlayAudio.class );
                                        startActivity(intent);
                                        Date = Variable.RDate[arg2];
                        }
                                
                        });         
         }
                private String SPLIT(String html, String spl1, String spl2){
                        String[] result = html.split(spl1);
                        String[] result1 = result[1].split(spl2);
                        
                        return result1[0];
                        
                }
}

추천 비추천

0

고정닉 0

0

댓글 영역

전체 댓글 0
등록순정렬 기준선택
본문 보기

하단 갤러리 리스트 영역

왼쪽 컨텐츠 영역

갤러리 리스트 영역

갤러리 리스트
번호 제목 글쓴이 작성일 조회 추천
설문 시세차익 부러워 부동산 보는 눈 배우고 싶은 스타는? 운영자 24/05/27 - -
223671 크롬 다운로드 안되는거 해결방법아는사람 ? [4] 김늅늅(183.102) 10.12.09 92 0
223670 GetTickCount()보다 정교한 시간 함수 없나요? [2] 시간없음(211.54) 10.12.09 94 0
223669 lick my ass [4] 세제맛홍초(110.15) 10.12.09 88 0
223667 리트머스 시험지 식초맛비누(110.15) 10.12.09 54 0
223665 말년신에게 보낸 편지에 답장이옴. [4] 부끄곰갤로그로 이동합니다. 10.12.09 130 0
223663 형들 html수정지원 안하는 게시판에선 스크립트실행을 못하는건가 [5] 지나가는나그네(110.10) 10.12.09 61 0
223662 aes 256 이 어느정도 되는 암호인가요? [4] llp(211.49) 10.12.09 113 0
223661 재입갤 슈크림맛라면(110.15) 10.12.09 44 0
223659 예전엔 몰랐는데... 환경이란게... 권혁진(58.233) 10.12.09 47 0
223657 형들아는 봅니다. [7] DMW(143.248) 10.12.09 91 0
223656 혹시 IEEE 읽을 수 있는 형 있엉? [6] prismatic갤로그로 이동합니다. 10.12.09 118 0
223655 오늘 이러고 등교함... [3] 분당살람갤로그로 이동합니다. 10.12.09 131 0
223653 해일리는 봇이다 [8] 무늬만사람(203.228) 10.12.09 143 0
223647 아 진짜 이 중딩모델 존나 귀여운듯 진짜 나 로리타 아닌데 진짜 [10] 형들아(220.73) 10.12.09 1453 0
223645 이바보랑 해일리는 봇인 듯 [5] 분당살람갤로그로 이동합니다. 10.12.09 96 0
223644 포멧 windows professional & 엑스키퍼 프리미엄 느금마갤로그로 이동합니다. 10.12.09 217 0
223642 모나미 인증하면 구글 검색어에 뜸 [1] 아주아슬갤로그로 이동합니다. 10.12.09 106 0
223641 자바에서 readLine.trim()이 뭐하는 녀석임? [2] 마타버터갤로그로 이동합니다. 10.12.09 95 0
223640 planet source code가면 소스가 무료 [3] 장은성(220.121) 10.12.09 103 0
223639 일끝났네 [1] 꿀레갤로그로 이동합니다. 10.12.09 63 0
223638 자바 질문.... [3] 불꽃(124.153) 10.12.09 47 0
223636 방학때 애들 밥주는걸 전액 삭감하냐? 개새끼들 [6] gisman갤로그로 이동합니다. 10.12.09 119 0
223635 아잉따잉이 장은성 가방모찌는 아닐터 [43] 장은성(220.121) 10.12.09 281 0
223634 야후나 구글에서 검색순위 상위에 뜨려면 뭘 해야 하지? [7] 펵숟(59.5) 10.12.09 165 0
223633 시험까지 8시간 남았다. [5] 땡칠도사갤로그로 이동합니다. 10.12.09 91 0
223631 알이 짝짜기 [7] rntjr갤로그로 이동합니다. 10.12.09 132 0
223630 금방 다스텍에서 전화왔음.. [4] 꿀레갤로그로 이동합니다. 10.12.09 101 0
223629 콘솔 지렁이 [6] 김늅늅(61.40) 10.12.09 145 0
223626 형들 씨언어 질문좀 ㅠㅠ 하루종일 고민중 [9] ㅁㄴㅇ(115.143) 10.12.09 131 0
223625 강제 삭제 프로그램좀.. [5] ㅠㅠㅠ(121.182) 10.12.09 227 0
223623 시리얼통신 관련 프로그램을 만들고 있는데요.. 곰보(121.132) 10.12.09 252 0
223622 대딩 숙제 대신해주면... [3] 꿀레갤로그로 이동합니다. 10.12.09 100 0
223620 "갤럭시S 히트 제 SW디자인도 한몫했죠" [2] ㅁㄴㅇ(121.169) 10.12.09 154 0
223619 대딩 숙제사업좋은데? [5] 홍어(58.180) 10.12.09 117 0
223617 슬슬 이제 애플도 변화할 때 가 온거야 [2] 홍어(58.180) 10.12.09 95 0
223612 vhdl로 전가산기 설계하는 소스인데 질문점 [6] 햏자(211.57) 10.12.09 279 0
223611 흉들 혹시 postscript 관련 소스들좀 있어? [1] 치킨집조까(203.240) 10.12.09 62 0
223610 드...드디어!! 합격! [12] 외쳐EE!!(210.180) 10.12.09 324 0
223608 의뢰해결로 돈 버는 거슨 이미 불가능 분당살람갤로그로 이동합니다. 10.12.09 62 0
223607 애플의 동반성장 [3] Vita500갤로그로 이동합니다. 10.12.09 121 0
223606 프갤형들 여기서 놀면서 가끔 애들이 문제 해결해주는걸로 돈버는거나해. [3] 북괴(116.38) 10.12.09 122 0
223603 애니메이션이 순수하다니요 [5] 꿀레갤로그로 이동합니다. 10.12.09 123 0
223602 html 고수님들 사랑합니다 ~~(이미지 다운 태그나 스크립트 질문) [19] (210.124) 10.12.09 228 0
223601 c# splitContainer이거 질문쫌요 [2] 일광면(119.198) 10.12.09 1397 0
223599 C언어 고수님들 사람 하나 살려주세요 ㅠㅠ [2] 사랑해요형님(110.15) 10.12.09 119 0
223597 닭세권에 대한 최종판 정리 [5] 임베디드(115.94) 10.12.09 219 0
223596 막곡 [3] prismatic갤로그로 이동합니다. 10.12.09 51 0
223595 설마 XSL 서버설정때문에 이러냐? [9] URA!갤로그로 이동합니다. 10.12.09 79 0
223594 내가 슈ㅣ발 이번 클스마스때는 절대 프갤질 하지 않을꺼야 [5] 캐꼬꼬닭(112.216) 10.12.09 80 0
223593 아마가미 다른 짤들 [3] 땡칠도사갤로그로 이동합니다. 10.12.09 112 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2