Ali
Ali
İstanbul-I (Avrupa)
14/05/2014 tarihinden beri üye
200 GY Puanı
33K GY Sırası

Kişisel Sayfaları

İlgi Alanları

2 Rozet
0 Sertifika
2 Soru Sordu
3 Cevap Verdi
0 Blog Yazısı
0 Etiket Takibi

Hakkında

İş Tecrubesi

Kullanıcıya ait İş tecrübesi bilgisi bulunmamaktadır.

Eğitim Geçmişi

Fırat Üniversitesi
| Aralık 2020 - Aralık 2020

Sertifikalar & Başarılar

GY Sertifikaları (0)
Kullanıcının GY sertifikası bulunmamaktadır.
Diğer Sertifikaları (0)
Kullanıcıya ait sertifika bulunmamaktadır.
Test Sonuçları (0)

Kullanıcıya ait test sonucu bulunmamaktadır.

Dil Becerileri

Son Forum Aktiviteleri

5
Tümünü Gör

ListView Görüntüleme Sorunu

Herkese merhaba;

Dropbox benzeri bir arayuz tasarlamaktayım. Uygulamada TabHost aracını kullanıyorum. 1.sekmede dosyalar yer alacak. Dosya listeisini görüntülemeye çalışıyorum, hiçbir hata almama rağmen liteyi görüntüleyemiyorum. Kodlar Aşağıda;

MainActivity.java

[code]

package com.example.arayuz;

import java.util.ArrayList;
import java.util.List;

import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.os.Build;
import com.example.arayuz.*;

public class MainActivity extends TabActivity {
    

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        TabHost tbHost = getTabHost();
        TabHost.TabSpec sekme;
        Intent t;
        
        t = new Intent(this,Sayfa1.class);
        sekme = tbHost.newTabSpec("sekme1").setIndicator("",
                getResources().getDrawable(R.drawable.utilities_file_archiver)).setContent(t);
        tbHost.addTab(sekme);
        
        t = new Intent(this,Sayfa2.class);
        sekme = tbHost.newTabSpec("sekme2").setIndicator("",
                getResources().getDrawable(R.drawable.star)).setContent(t);
        tbHost.addTab(sekme);
        
        t = new Intent(this,Sayfa3.class);
        sekme = tbHost.newTabSpec("sekme1").setIndicator("",
                getResources().getDrawable(R.drawable.bell)).setContent(t);
        tbHost.addTab(sekme);
        
        t = new Intent(this,Secenekler.class);
        sekme = tbHost.newTabSpec("sekme1").setIndicator("",
                getResources().getDrawable(R.drawable.settings)).setContent(t);
        tbHost.addTab(sekme);

    }
}

[/code]

activity_main.xml

[code]

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.arayuz.MainActivity"
    tools:ignore="MergeRootFrame" >

    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" 
            android:layout_alignParentLeft="true">

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                
                android:orientation="horizontal"
                android:tabStripEnabled="@bool/abc_config_showMenuShortcutsWhenKeyboardPresent" >

            </TabWidget>

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <LinearLayout
                    android:id="@+id/tab1"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal" >

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/tab2"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal" >

                    <Gallery
                        android:id="@+id/gallery1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/tab3"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal" >
                </LinearLayout>
                
                <LinearLayout
                    android:id="@+id/tab4"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal" >
                </LinearLayout>

            </FrameLayout>
        </LinearLayout>
    </TabHost>

</FrameLayout>

[/code]

satir_gorunum.xml

[code]

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/file_icon"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:src="@drawable/abc_ab_bottom_transparent_dark_holo" />

    <TextView
        android:id="@+id/file_name"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:text="File Name"
        android:textSize="15dp" />

</LinearLayout>

[/code]

files.java

[code]

package com.example.arayuz;

public class files {
    private String isim ;
    private String tur;
    
    public files(String isim,String tur){
        this.isim = isim ;
        this.tur = tur;
    }

    public String getIsim() {
        return isim;
    }

    public void setIsim(String isim) {
        this.isim = isim;
    }

    public String getTur() {
        return tur;
    }

    public void setTur(String tur) {
        this.tur = tur;
    }

}

[/code]

ozelAdapter.java

[code]

package com.example.arayuz;

import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ozelAdapter extends BaseAdapter {
    private LayoutInflater mInflater;
    private List<files> mFileList;
    
    public ozelAdapter (Activity activity, List<files> files){
        mInflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mFileList = files;
    }

    @Override
    public int getCount() {
        
        return 0;
    }

    @Override
    public Object getItem(int position) {
        
        return null;
    }

    @Override
    public long getItemId(int position) {
        
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View SatirView;
        SatirView = mInflater.inflate(R.layout.satir_gorunum, null);
        TextView textView = (TextView) SatirView.findViewById(R.id.file_name);
        ImageView imageView= (ImageView) SatirView.findViewById(R.id.file_icon);
        
        files file = mFileList.get(position);
        textView.setText(file.getIsim());
        
        imageView.setImageResource(R.drawable.folderopened_yellow);
        
        return SatirView;
    }

}

[/code]

activity_sayfa1.xml

[code]

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.arayuz.Sayfa1"
    tools:ignore="MergeRootFrame" >

    <ListView
        android:id="@+id/liste"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>

</RelativeLayout>

[/code]

Sayfa1.java

[code]

package com.example.arayuz;

import java.util.ArrayList;
import java.util.List;

import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.os.Build;

public class Sayfa1 extends ActionBarActivity {
    final List<files> fileList = new ArrayList<files>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sayfa1);
        final ListView listemiz = (ListView) findViewById(R.id.liste);
        fileList.add(new files("Müzikler","ses"));
        fileList.add(new files("Resimler","görüntü"));
        fileList.add(new files("Ders Notları","döküman"));
        fileList.add(new files("Döküman","döküman"));
        fileList.add(new files("Projeler","belge"));
        fileList.add(new files("Programlar","exe"));
        ozelAdapter adaptorumuz=new ozelAdapter(this, fileList);
        listemiz.setAdapter(adaptorumuz);   
    }

}

[/code]

"fragment_main.xml'İ " Doğru mu Kullanıyorum

Hepinize merhaba geleceğği yazanlar ekibi benim bir sorum; Hepinizin bildiği gibi son sürüm android sdk'da proje oluşturulduğunda fragment_main.xml şeklinde bir dosya oluşmakta önceden sadece main_activity.xml vardı fragmentin ne olduğunu anladım fakat fragment_main.xml layoutunu kullanamıyorum. Gerekli itemleri fragment layoutuna yerleştirip main activity içeirsinde nesneleri oluşturup gerekli işlemleri yapmaya kalktığımda hep hata alyorum.Kkodları şu kod bloğu içersine yazıyorum

[code]

public static class PlaceholderFragment extends Fragment {

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_main, container, false);
            return rootView;
        }
    }

[/code]

Gördüğünüz gibi bu kod bloğunda PlaceholderFragment sınıfı bir fragment sınıfı. Ben kodlarımı bu yüzden buraya yazıyorum. Acaba doğrumu yapıyorum.(ki zannnetmiyorum doğru yapsam çalışırdı).Birde sizden ricam fragmentlarla ilgili bir ders yok heralde onunla ilgili bir des eklerseniz eğer çok iyi olur bizler için. Şimdilik projeleri fragment_main.xml 'i görmezden gelerek yapıyorum :)))

9 yıl 10 ay önce yanıtladın

1 Senede ne kadar ilerleyebilirim?

03 Ağustos 2014 tarihinde cevaplandı

Öncelikle yeni bölümün hayrılı  olsun bende  Fırat Üni. yazılım  müh. deyim bu  sene 3. sınıfa geçtim eğer merak ettiğin  bir şey varsa bana sorabilirsin.

Buton yapma programı

28 Mayıs 2014 tarihinde cevaplandı

adobe photoshop