What exactly is “label” parameter in ClipData in Android?

后端 未结 3 1191
無奈伤痛
無奈伤痛 2020-12-30 18:34

According to the Android documentation, ClipData use \"label\" as a kind of representation to the copied data.

ClippedData is a complex type containin

3条回答
  •  一个人的身影
    2020-12-30 18:56

    ClipData clip = ClipData.newPlainText(
                "text label", 
                "content to be copied");
    

    here text label describes what data is in clip

    eg.

    ClipData clip = ClipData.newPlainText(
                "user Name",
                user.getName()); 
    

    we can retrive this by using

    clip.getDescription ();
    

提交回复
热议问题